natjohan's blog

Posted lun. 07 janvier 2013

Tip of the week 3

Test email sending in local

Sometimes, you have to check if your email application works for your devs, but you don't want to importunate your users to test it. So you should test it in local, and verify that emails will be sent to the right people, and that those emails will contain the correct content. One way to test test it, is to run this python command that run a simple smtp server that receive and display emails locally in your terminal (in this example, the server listening on port 1025)

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

Go Further

Just read the smtpd python documentation

Category: ToTW
Tags: tool tip mail python

Comments