Support for sending/receiving emails in Flexible Environments?

215 views
Skip to first unread message

Mattia Iavarone

unread,
Sep 7, 2016, 2:19:41 PM9/7/16
to Google App Engine

Standard environment projects have a specific page in the documentation about Receiving emails. For example, https://cloud.google.com/appengine/docs/java/mail/receiving-mail-with-mail-api here for Java.

It is told that you can have mails sent to <string>@<appid>.appspotmail.comand they will be delivered as HTTP POST requests on certain endpoints that you can control.

However, there’s nothing like this in the documentation for Node.js. It is told that you can send emails through some providers like Mailgun or Mailjet, but we already knew that. There’s no info about managing a email address in the appspotmail.com domain, nor in appspot.com.

The problem is that for deliverability services like Mailjet require you to have a verified email address in your domain.
As a GAE user, we have our domain (e.g. <id>.appspot.com) but apparently no way to set up an email address.

Is this true? No Mail API for Node.js?
What should I do?

Thank you.

Nick

unread,
Sep 7, 2016, 4:49:33 PM9/7/16
to Google App Engine
It seems as though app engine is moving away from supporting email first class.

Most email saas providers support recieving email and invoking a webhook, look at mailgun, send grid or similar.

They'll all have verification processes to avoid supporting spam, you may have to register a domain and set up some TXT and MX records. Plus you'll want to do this if you care about deliverability anyway

Mattia Iavarone

unread,
Sep 8, 2016, 2:35:22 PM9/8/16
to Google App Engine
you may have to register a domain

Yes, and that’s the annoying part, since Java/Python GAE users get this out of the box. 

Mattia Iavarone

unread,
Sep 9, 2016, 6:44:19 PM9/9/16
to Google App Engine
Actually, I was just able to "receive an email”.

Although being on Node.js, I followed part of the Python guide, which also uses app.yaml as a configuration file. See here.
I had to add this to my app.yaml file:

inbound_services:
- mail

Then, as the guide says, you can receive mails to <anystring>@<app-id>.appspotmail.com .
Instead of configuring script handlers in app.yaml I just used express:

app.post(‘/_ah/mail/nor...@my-app-id.appspotmail.com’, function(req,res) {
    console.log(‘Got email’);
});

Have not checked how to parse the request and if the email body is delivered or not.
Of course there’s no Node.js client provided as for Python for example.

I won’t be using this since it is not documented and, in the end, not worth it as is.
So, to Google Developers: I think you should either remove mail delivery for node.js apps, or document this behavior.
Possibly document and provide a Mail API for node folks too! :-)

Reply all
Reply to author
Forward
0 new messages