Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Google App Engine use a third party SMTP server?

Google App Engine currently limits you to 2,000 emails per day (for free) via their API.

I am trying to find a definitive answer if it is possible to use a third-party system if you need to send more. I know that they disallow raw sockets, so I would assume that there might be trouble with this approach... but surely I'm not the first to see it.

Worst case, I can build a simple offsite web service that my GAE can call... but I'd much rather just be able to send directly through an SMTP server.

Thanks!

like image 947
Michael Gorsuch Avatar asked Oct 22 '10 20:10

Michael Gorsuch


People also ask

What email does Google App Engine use?

The mail API provides two ways to send an email message: the mail. send_mail() function and the EmailMessage class. This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment.

Does Google block port 25?

To use a Google Workspace domain: Follow the instructions for SMTP relay service settings in the Google Workspace documentation. SMTP relaying through Google Workspace is only allowed through ports 465 or 587. Port 25 is not supported through Google Workspace.

How do I allow third party email in Gmail?

Go to the Security section of your Google Account. Under “Third-party apps with account access,” select Manage third-party access. Select the app or service you want to review.


2 Answers

Nope.

You're correct: you cannot make raw socket requests, nor any other direct outbound requests except through the urlfetch API. To talk to an external SMTP server, you would need to use a webservice as a proxy.

like image 58
Drew Sears Avatar answered Oct 15 '22 10:10

Drew Sears


We use the Postmark mail outsourcing service via the hutools.postmark API. Since the communication is HTTP based, it works like a charm on Google AppEngine. This might be an option for you, although it is also a for-pay service. We use it to get arround GAEs sender restrictions.

like image 36
max Avatar answered Oct 15 '22 08:10

max