In 2008, over one thousand people experienced the world’s first virtual web conference. Together, we created a new type of conference that is environmentally-friendly, affordable, and interactive.

In 2009, we are going to take it one step further.


Testing mail locally with the Google App Engine Development Web Server

The Google App Engine Mail API lets you easily send email from your applications. However, I found it difficult to test it locally when using the Development Web Server.

The documentation states that you can either use an existing SMTP provider or sendmail with the local server but the former solution didn't work for me with GMail or the SMTP server at my web host. And, from a quick Google search for sendmail, I got the impression that I should stay away from it.

In the end, I opted to use a simple Python-based SMTP server by Les Smithson to debug my mail calls locally.

It's very simple to use:

  1. Download the smtps.py script.
  2. In Terminal, change to the folder you downloaded the script into and run it with python smtps.py <port number>, replacing <port number> with the port you want the SMTP server to listen on.
  3. Start your Google App Engine Dev Web Server with dev_appserver.py --smtp_host=localhost --smtp_port=<port number>.

That's it! Now test your Google App Engine application locally in the Development Web Server and the contents of email messages sent by your application will appear in the Terminal window running the SMTP server.

Post Metadata

Date
April 12th, 2008

Author
Aral


3 Comments

  1. Hey, do you think this will work for web designs integrated with joomla at local machines because at times I really cannot check smtp without going to online server



  2. Nora

    Thank you very much for a very help tip indeed. I have been trying to get this email option to work all day and did not get anywhere!
    Just one question, now I will not get real emails sent to my email account but if it shows it is successful in the other console that listens to the port then does that mean it is working fine?

    thank you very much…very grateful!


  3. Yep, that’s right: you will only see the emails in the console :)


Leave a Reply