Changeset 9793: SMTP testing documentation. I didn’t know this trick: running “python -m smtpd -n -c DebuggingServer localhost:1025” will start up a simple SMTP server which dumps received e-mails to the terminal instead of forwarding them on.
Changeset 9793: SMTP testing documentation. I didn’t know this trick: running “python -m smtpd -n -c DebuggingServer localhost:1025” will start up a simple SMTP server which dumps received e-mails to the terminal instead of forwarding them on.
Excellent find! I'll have to remember this (bookmarked).
Thanks!
I saw the original feature request on the Django 1.1 list and researched and wrote a blog post on it here:
http://rob.cogit8.org/blog/2008/Nov/20/testing-ema ils-django/
We were considering a new management command or new options to runserver but ultimately decided this was so simple that documentation was all it needed.
There's other fun stuff one can do with by subclassing Python's smptd server.
This is very good to know.
It would be extremely useful if the Django debug server was able to launch an instance of this, triggered off a settings.py field like:
SMTP_USE_DEBUG_SERVER = True