Send Messages from AppEngine Locally

The message subject says it all: I want to be able to send emails from AppEngine when it runs locally. As far as I understood from this post:

to send emails from google appengine

I need to set up a mail server. Can someone tell me some simple steps to install a mail server locally and use it with Google AppEngine?

+4
source share
2 answers

Ok, I found a good solution for this question. Basically, just install the sendmail tool, then use the --enabled_sendmail option when calling dev_appserver.py. So here is what I did (I use Ubuntu):

sudo apt-get install sendmail 

Then whenever I call dev_appserver.py, I call it like this:

 ~/google_appengine/dev_appserver.py --enable_sendmail --port=8081 ./appengine/ 

Note the --enable_sendmail option.

I believe that there can be no easier solution than this :-)

+6
source

Why do you want to send mail from AppEngine while running locally? If this is for testing purposes only, Python comes with a built-in SMTP server that will go to the console for you:

python -m smtpd -n -c DebuggingServer localhost:1025

0
source

Source: https://habr.com/ru/post/1332804/


All Articles