Forums

Trying to send email gets "Error: authentication failed: (reason unavailable)"

I've been having some issues with sending emails from my Django webapp. It works locally, but not on PA. I'm not using gmail, but a PrivateEmail with my domain. The error I'm getting is:

Error running WSGI application
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Error: authentication failed: (reason unavailable)')

and my settings are:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mail.privateemail.com'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
EMAIL_PORT = 587
EMAIL_HOST_USER = # email
EMAIL_HOST_PASSWORD = # password
DEFAULT_FROM_EMAIL = # email

I'm not too sure where to go from here since the error says "reason unavailable." Any help would be appreciated, thanks!

Are email and password hardcoded in your settings or do you load them somehow?

I load them from my .env file. It works locally, and the email/password are the same in my PA .env file as well.

Wait--I forgot I added a new .env file and I was editing the old one. I'll change the email on the new one and see how that goes.

Ok, let us know how it goes.

Yep, that was the issue. It's working now.

Great, thanks for confirming!