3

I'm attempting to get a django site up and running and I'm trying to enable django's standard password reset service.

My site is hosted by AWS EC2, so I figured I would use AWS SES for my email service. However, I can't get the smtp connection to work. Any idea on how to solve for the following error:

Exception Type: SMTPSenderRefused Exception Value: (530, b'Authentication required', 'example@example.com')

I've looked at the following, but I'd prefer to stay with django's built-in email back-ends if possible:

Email Settings:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'email-smtp.us-west-2.amazonaws.com'
EMAIL_PORT = 587 # (I've also tried 25, 465, & 2587)
EMAIL_HOST_USER = ''
EMAIL_PASSWORD = ''
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'example@example.com' # but my real email address

My EMAIL_HOST_USER and EMAIL_PASSWORD are set to my SMTP credentials I obtained by following the instructions at: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html

Also, I was sure to verify my DEFAULT_FROM_EMAIL and my domain following these instructions: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html

And DKIM is enabled and my nameservers have been updated.

Any help would really be appreciated.

UPDATE:

I was able to get the django email send working with the django-ses 3rd party library, but I'm still not able to figure out why the standard backend doesn't work via SMTP.

I think there is definitely something wrong with my code as I went so far as to switch email clients from AWS SES to Zoho mail and I'm still receiving the same 530 Authentication required error.

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.zoho.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'support@example.com'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'support@example.com'
EMAIL_PASSWORD = ''
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Daniel Long
  • 1,162
  • 14
  • 30

1 Answers1

0

If it is asking for Authentication, please double-check the following:

  • Your SMTP settings
  • The email that you're trying to send mails from belongs to the verified domain. e.g. if you have verified example.com but you try sending emails from something@gmail.com, it is going to ask for gmail auth credentials.
unixia
  • 4,102
  • 1
  • 19
  • 23
  • I've confirmed my SMTP credentials and server information are correct. I even tried creating another set of credentials to see if I could have originally copied them incorrectly. And I am sending from the verified domain with a verified email. Any other settings I should take a look at? – Daniel Long Feb 26 '18 at 06:29
  • Could you please once try sending test email from SES (from AWS console)? – unixia Feb 26 '18 at 06:41
  • I was able to send a test email using SES. In fact I was able to get this working using django-ses lib. I'll update the original question with my findings – Daniel Long Feb 27 '18 at 04:51