4

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

to send emails from Google appengine

I have to setup a mail server. Can anyone tells me some easy steps to install a mail server locally and use it with Google AppEngine?

Community
  • 1
  • 1
Rafid
  • 18,991
  • 23
  • 72
  • 108

2 Answers2

6

OK, I found a good solution for this question. Basically, just install sendmail tool, then use the option --enabled_sendmail 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/

Notice the --enable_sendmail option.

I believe there can't be an easier solution than this :-)

Rafid
  • 18,991
  • 23
  • 72
  • 108
0

Why do you want to send mail from AppEngine while running locally? If it's just for testing purposes, Python comes with a built-in SMTP server that will log to the console for you:

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

girasquid
  • 15,121
  • 2
  • 48
  • 58
  • I am developing an application using AppEngine. Obviously, I need to keep making changes and upload them. But since AppEngine is slow an uploading data (take around 1 minute sometime), it is easier much to keep it working locally and use ssh to redirect any requests to my server to my local machine. This is very useful and makes development faster, but it is sometime limited. – Rafid Dec 20 '10 at 18:54
  • So will it be enough to just run the command you mentioned? Isn't there any configuration so that AppEngine recognize this SMTP server? – Rafid Dec 20 '10 at 18:54
  • 1
    I'm afraid there's configuration involved, yes - you'll need to rework your code to use this (external) SMTP server instead of the AppEngine SMTP server. You might also be able to try your redirecting trick with the SMTP server as well, if you know what you're looking for (I don't). – girasquid Dec 20 '10 at 18:59
  • 1
    @Rafid If you don't set up outgoing mail on the dev_appserver, you can still test it, though - email will be output to the console. – Nick Johnson Dec 20 '10 at 20:21