I have configured my Django settings to send an e-mail using gmail (for password reset) However, I'm facing a strange behaviour from Google:
>>> from django.core.mail import send_mail
>>> send_mail("Objet3", "Message body", "[email protected]",['[email protected]'], fail_silently=False)
1
However, when using the deployed app, I always get a Server Error 500, which is reported as such by Sentry:
SMTPSenderRefused: (530, b'5.7.0 Authentication Required. Learn more at\n5.7.0 https://support.google.com/mail/?p=WantAuthError f6sm10267338edk.13 - gsmtp', 'webmaster@localhost')
It's really puzzling, as at Gmail:
Google does not want to be an email provider like this so they've made it increasingly difficult. Look into a provider such as sendgrid, mailgun, or others.