Note that there are some explanatory texts on larger screens.

plurals
  1. POSet up mail to receive emails on Google App Engine
    primarykey
    data
    text
    <p>The documentation is rather incomplete. I could not set up the inbound email. Here are some details:</p> <p>app.yaml:</p> <pre><code>handlers: - url: /_ah/mail/owner@oladic\.appspotmail\.com script: handle_owner.py login: admin - url: /_ah/mail/support@oladic\.appspotmail\.com script: handle_support.py login: admin - url: /_ah/mail/.+ script: handle_catchall.py login: admin - url: .* script: main.py inbound_services: - mail </code></pre> <p>handle_catchall.py:</p> <pre><code># To change this template, choose Tools | Templates # and open the template in the editor. import logging, email from google.appengine.api import mail from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext.webapp.mail_handlers import InboundMailHandler class LogSenderHandler(InboundMailHandler): def receive(self, mail_message): logging.info("================================") logging.info("Received a message from: " + mail_message.sender) plaintext_bodies = message.bodies('text/plain') html_bodies = message.bodies('text/html') for content_type, body in html_bodies: decoded_html = body.decode() logging.info("content_type: " + content_type) logging.info("decoded_html: " + decoded_html) attachments = [] if message.attachments: if isinstance(message.attachments[0], basestring): attachments = [message.attachments] else: attachments = message.attachments logging.info("number of attachments: " + str(len(attachments))) for filename, content in attachments: logging.info("plaintext_bodies: " + plaintext_bodies) logging.info("filename: " + filename) content logging.info("--------------------------------") def main(): application = webapp.WSGIApplication([LogSenderHandler.mapping()], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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