Amazon SES SMTP with Django Amazon SES SMTP with Django python python

Amazon SES SMTP with Django


Thanks everyone for the recommendations but I finally found a much simpler solution that would allow me to use Django's built-in mail classes so I can still get my admin error email reports etc.

Thanks to this little beauty I was able to use SES SMTP without any problems:

https://github.com/bancek/django-smtp-ssl

Download and install (python setup.py install)

Then just change your settings to use this new email backend:

EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'

The rest of the settings are as per normal:

EMAIL_HOST = 'email-smtp.us-east-1.amazonaws.com'EMAIL_PORT = 465EMAIL_HOST_USER = 'my_smtp_username'EMAIL_HOST_PASSWORD = 'my_smtp_password'EMAIL_USE_TLS = True

Nice.

G


2019 Update: Django 2.2.1

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'EMAIL_HOST = 'email-smtp.us-east-1.amazonaws.com'EMAIL_PORT = 587EMAIL_HOST_USER = 'my_smtp_username'EMAIL_HOST_PASSWORD = 'my_smtp_password'EMAIL_USE_TLS = True

No library needed.

Credits : https://stackoverflow.com/a/32476190/5647272

Reference : https://docs.djangoproject.com/en/2.2/topics/email/


Since Django 1.7, you can send email with SSL natively without third party library.

EMAIL_USE_SSL = True

Docs