On Nov 19, 2:20 pm, Geoffrey Spear <
geoffsp...@gmail.com> wrote:
> To simulate email in the dev server, you need to use the dashboard athttp://localhost:8081/_ah/admin/
Thanks. I send an email from
http://localhost:8081/_ah/admin/inboundmail
but I am confused about how to access the content of the email "text"
in the following script. I created a handle_incoming_email.py script
and put the following handler in it:
class ReceiveEmail(InboundMailHandler):
def receive(self,message):
logging.info("Received email from %s" % message.sender)
plaintext = message.bodies(content_type='text/plain')
for text in plaintext:
txtmsg = ""
txtmsg = text[1].decode()
logging.info("Body is %s" % txtmsg)
self.response.out.write(txtmsg)
application = webapp.WSGIApplication([
ReceiveEmail.mapping()
], debug=True)
I assume that "plaintext" contains the body of the email and it is
decoded into "txtmsg". Correct? How do I access this "txtmsg"?
Thanks again.