I am deploying a Django project on an ubuntu stack with a postfix SMTP mail server, hosted on Amazon's EC2. I can send out email from the server using the Linux mail program. But when I try to send email using django.core.mail.send_mail, the email is never received.
Here are my settings:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
I left everything else as default.
I tried
python manage.py shell
Then in the shell, I did
from django.core.mail import *
send_mail(
'TEST',
'THIS IS A TEST',
'[email protected]',
['[email protected]'],
fail_silently=False,
)
This returns 1, but I never received any message at the destination ('[email protected]' in the example).
Is there a tutorial on how to configure a SMTP server to work with Django's mail system? Thanks.