Testing e-mail sending locally in Django
November 21st, 2009 | 1 comment |
If you need to test you Django app’s email sending functionality locally, you’re in luck. Python has a built in “dumb” SMTP email server for doing just that.
All you need to do to run it is open up your console and type:
python -m smtpd -n -c DebuggingServer localhost:1025Then just change your settings.py file to have these settings:
EMAIL_HOST = "localhost" EMAIL_PORT = 1025… and any email sent from your local Django app will show up in the console for you to view.
See this page for more info: http://docs.djangoproject.com/en/dev/topics/email/#testing-e-mail-sending
Hope that helps, cheers!
Thank’s for this tip.