You are here: Home Blog Running a test mail server

Running a test mail server

by Dan Fairs last modified Nov 16, 2009 12:41 PM
A quick tip to ease testing emails.

Just a quick one for today.

Often I find myself needing to test email sending functionality. I often don't have access to a full mail server, so it's handy to be able to run something up locally to test with. If you've got Python installed, then you can do this really easily. Assuming Python 2.6 on Linux:

python /usr/lib/python2.6/smtpd.py -n -c DebuggingServer localhost:8025

That will start a debugging mail server on port 8025 on your local machine. Simply configure your web app to use an SMTP server running on your dev machine on port 8025, and when the app sends an email, you should see it scroll by on your terminal.


Filed under:
Add comment

You can add a comment by filling out the form below. Plain text formatting.