0

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.

horse
  • 479
  • 7
  • 25

2 Answers2

1

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

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thank you so much. I began following that powershell guide before I made this post and stopped because I really had no idea what I was doing and was afraid it wasn't even right. Since you posted it I figured it must be right so persisted and got it working. Thank you. – horse Sep 27 '20 at 22:59
0

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
sohal07
  • 440
  • 8
  • 21