An SMTP server for testing

Today I needed to send some test emails from my application and I searched around for a very simple SMTP server that can save outgoing emails to a folder instead of actually sending them. This is nice for debugging and testing email functionality in an application.

Unfortunately, it was very difficult to find something useful. In the end, I found a very simple script that did the trick. I forked it and added some command-line options so now I can easily run a simple SMTP server on my development computer in Linux, like this: -p 8081

In case you were wondering, this works really well with the Google App Engine mail API. Simply run the development server like this: --smtp_host=localhost --smtp_port=8081

The source code for the server is right here:

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.