Note that there are some explanatory texts on larger screens.

plurals
  1. POMessage instance has no attribute 'read' in Google app engine mail receive
    text
    copied!<p>Code in receive handler </p> <pre><code>class LogSenderHandler(InboundMailHandler): def receive(self, mail_message): logging.info("Received a message from: " + mail_message.sender) #logging.info("Received a message from: " + mail_message.attachments) logging.info("Received a message from: " + mail_message.date) logging.info("Received a message from: " + mail_message.subject) report = DocFile() report.doc_name = mail_message.subject if mail_message.attachments is not None: report.doc_file = mail_message.attachments else: report.doc_file = mail_message.bodies(content_type='text/plain') report.put() application = webapp.WSGIApplication([LogSenderHandler.mapping()], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() </code></pre> <p>code in url.py </p> <pre><code>inbound_services: - mail handlers: - url: /_ah/mail/.+ script: handle_incoming_email.py </code></pre> <p>error when i try to send a simple email from <a href="http://localhost:8080/_ah/admin/inboundmail" rel="nofollow noreferrer">http://localhost:8080/_ah/admin/inboundmail</a></p> <pre><code>Message send failure Traceback (most recent call last): File "F:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 509, in __call__ handler.post(*groups) File "F:\Program Files\Google\google_appengine\google\appengine\ext\webapp\mail_handlers.py", line 58, in post self.receive(mail.InboundEmailMessage(self.request.body)) File "F:\Program Files\Google\google_appengine\google\appengine\api\mail.py", line 547, in __init__ self.update_from_mime_message(mime_message) File "F:\Program Files\Google\google_appengine\google\appengine\api\mail.py", line 1081, in update_from_mime_message mime_message = _parse_mime_message(mime_message) File "F:\Program Files\Google\google_appengine\google\appengine\api\mail.py", line 232, in _parse_mime_message return email.message_from_file(mime_message) File "F:\Python25\lib\email\__init__.py", line 66, in message_from_file return Parser(*args, **kws).parse(fp) File "F:\Python25\lib\email\parser.py", line 68, in parse data = fp.read(8192) AttributeError: Message instance has no attribute 'read' </code></pre> <p>EDIT This error comes only on local machine and not on app engine</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload