'Authentication Unsuccessful' When Trying To Send Email Through Django

5.4k Views Asked by At

I've been trying to send emails using my Outlook email through Django but have been getting a variety of error messages, including

(535, b'5.7.3 Authentication unsuccessful [SYBPR01CA0102.ausprd01.prod.outlook.com]')

Apparently I need to allow SMTP AUTH, but cannot find how to do this as I am using Outlook in my browser and don't have it downloaded (it keeps requesting I pay for it, but I'd prefer not to as I really don't see the need for this small project, unless I need to). I did however pay for the email.

I've also read that Outlook doesn't support smpt: Outlook 365 OAuth 535 5.7.3 Authentication unsuccessful

My settings in Django are:

DEFAULT_FROM_EMAIL = '###@###.###'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp-mail.outlook.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '###@###.###'
EMAIL_HOST_PASSWORD = '########'

My question is can I send Outlook emails through Django? If so, what am I doing wrong?

Thank you.

2

There are 2 best solutions below

1
On BEST ANSWER
0
On

I had the same issue and I called Microsoft support. They instructed me to change some security properties in Microsoft Azure. Here is my answer.