1

Difficult to phrase this question and what I've done as I don't know where the error is occuring.

I'm using Django hosted on AWS Elastic Beanstalk and SES to send emails. (Only for password reset) However the password reset emails don't seem to be sending.

When I try to send an email as below however it works.

 send_mail('Test', 'Email content', 'email@email.com',['email@email.com',])

Also locally the password reset email sends (its put in spam but that's a different issue)

My email settings are:

EMAIL_HOST = 'smtp.gmail.com' # mail service smtp
EMAIL_HOST_USER = 'email@email.com' # email id
EMAIL_HOST_PASSWORD = '****' #password
EMAIL_PORT = 587
# EMAIL_USE_TLS = True

EMAIL_BACKEND = 'django_ses.SESBackend'

AWS_ACCESS_KEY_ID = 'ACCESSKEY'
AWS_SECRET_ACCESS_KEY = 'SECRETKEY'
AWS_SES_REGION_NAME = 'eu-west-1'
AWS_SES_REGION_ENDPOINT = 'email.eu-west-1.amazonaws.com'
DEFAULT_FROM_EMAIL= 'email@email.com'

If it's relevant, anywhere I've written email@email.com is actually the same email.

Any help would be much appreciated.

Thanks

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Nowandthen98
  • 300
  • 1
  • 3
  • 13
  • Are you sure your host should be smtp.gmail.com? In these examples the host is from Amazon’s domain https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-programmatically.html – estinamir Dec 10 '18 at 18:19
  • I've tried setting the Email Host to 'email-smtp.eu-west-1.amazonaws.com' and the port to '465' but I get the same problem. send_mail() works but the reset does not – Nowandthen98 Dec 10 '18 at 18:28
  • Here it says you can use django-ses plugin https://stackoverflow.com/q/48981296/10634638 – estinamir Dec 10 '18 at 19:02
  • I am using that plugin for the backend. – Nowandthen98 Dec 10 '18 at 19:08
  • Strange that it works for him (see his Update), do you get any errors? – estinamir Dec 10 '18 at 19:15

0 Answers0