Amazon SES SMTP with Django

前端 未结 7 1844
悲&欢浪女
悲&欢浪女 2021-01-30 05:48

I\'m trying to use Amazon\'s new SMTP service for SES with Django 1.3.1 but I\'m not having much luck.

I\'ve created my SES SMTP credentials and have this in my settings

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 05:59

    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 = 465
    EMAIL_HOST_USER = 'my_smtp_username'
    EMAIL_HOST_PASSWORD = 'my_smtp_password'
    EMAIL_USE_TLS = True
    

    Nice.

    G

提交回复
热议问题