Alex Rivera | Logout

Test sending email without email server

Asked 2011-01-09T21:40:42.617
78

I have a Django application that sends an email. The production server has an email server but my local box does not. I would like to be able to test sending of email locally. Is there any way that I can have django not send it through the email server and just print out to a file or console?

Edit
Report

1 Answer

143

You can configure your application to use the Console Backend for sending e-mail. It writes e-mails to standard out instead of sending them.

Change your settings.py to include this line:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

Don't forget to remove it for production.

answered 2011-01-09T22:15:30.513

Your Answer