Hello,
I created register.py to receive email from users. I added register.py
to app.yaml by copying the code from the tutorial
http://code.google.com/appengine/docs/python/mail/receivingmail.html
application: hello-1-world
version: 1
runtime: python
api_version: 1
handlers:
- url: /favicon.ico
static_files: static/images/favicon.ico
upload: static/images/favicon.ico
- url: /_ah/mail/regis...@.*hello-1-world\.appspotmail\.com
script: register.py
login: admin
- url: /_ah/mail/.+
script: incoming.py
login: admin
- url: /.*
script: hw.py
inbound_services:
- mail
And this is the register.py:
class User(db.Model):
userEmail = db.StringProperty()
userEmailContent = db.StringProperty()
....
class Register(InboundMailHandler):
def receive(self, message):
newUser = User(userEmail = message.sender)
db.put(newUser)
application = webapp.WSGIApplication([
ReceiveEmail.mapping()
], debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
But when I send an email from Development Console Inbound Mail I get
this error:
Message send failure:
ReceiveEmail.mapping()
NameError: name 'ReceiveEmail' is not defined
I have the same code
application = webapp.WSGIApplication([
ReceiveEmail.mapping()
], debug=True)
in the other script "incoming.py" and it all works. What am I doing
wrong? Thank you!
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.