Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Google App Engine

You're reading from   Mastering Google App Engine Build robust and highly scalable web applications with Google App Engine

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784396671
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Receiving e-mails


Receiving e-mails is pretty much a simple thing in Google App Engine. First, you have to enable the incoming e-mails for your app. This can only be done in your app.yaml file (as there's nothing on the application settings when deployed). To do this, you add the following line to app.yaml:

inbound_services:
- mail

Now, how are the e-mails delivered to your app? Can you pull them on your own? The answer is that the e-mails are delivered to your application as HTTP POST requests. So, which URL do they hit? That's actually /_ah/mail/address, where address is the e-mail address to which the e-mail is sent.

The e-mail address should be of the following form:

account@appid.appspotmail.com

Here, account can be anything that you like, and appid is your application ID from app.yaml. To handle the incoming requests at sales@myapp.appspotmail.com, you can have the following handler:

- url: /_ah/mail/sales@myapp\.appspotmail\.com
script: my_email_handler.app
login: admin

Let's look at the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime