django-ses / django-ses

A Django email backend for Amazon's Simple Email Service
http://hmarr.com/2011/jan/26/using-amazons-simple-email-service-ses-with-django/
MIT License
1.02k stars 227 forks source link

Problem to send mails #162

Open csarcom opened 5 years ago

csarcom commented 5 years ago

I have this config:

AWS_SES_ACCESS_KEY_ID = 'SOMETHING'
AWS_SES_SECRET_ACCESS_KEY = 'SOMETHING'
AWS_SES_REGION_NAME = 'us-east-1'
AWS_SES_REGION_ENDPOINT = 'email-smtp.us-east-1.amazonaws.com'
EMAIL_BACKEND = 'django_ses.SESBackend'
EMAIL_HOST_TO = 'SOMETHING'
EMAIL_HOST_USER = 'noreply@email-smtp.us-east-1.amazonaws.com'

I am using django.core.mail.EmailMessage and I get this error after some seconds:

File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 279, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-3940450689

Any ideia why?

llloo commented 5 years ago

set AWS_SES_REGION_ENDPOINT = 'email.us-east-1.amazonaws.com'