Reputation: 501
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.
Upvotes: 0
Views: 5767
Reputation: 482
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.
Upvotes: 0
Reputation: 66316
Make sure SMTP authentication is enabled for your tenant. See https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission and https://learn.microsoft.com/en-us/azure/active-directory/fundamentals/concept-fundamentals-security-defaults
Upvotes: 1