Unable send email from the django using office 365

Unable to send email from Django using Office 365,

EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’

EMAIL_PORT = 587

EMAIL_USE_TLS = True

MAIL_HOST = ‘smtp.office365.com

EMAIL_HOST_USER = ‘pepito.perez@example.com’

EMAIL_HOST_PASSWORD = ‘something’

I test using the three Microsoft options on this web and nothing, I did use Gmail and I get no issues but office365 I was not able.

Office 365 has lot of filters and I think is one of the most complicated platforms in order to use email as a service.

Do you need to use this service? You can use other providers in order to function with Django and keep your normal mail with Office 365.

Did you solve this, I have the same issue

Yes, I have fixed the issue,

In your settings.py you have to setup your email account, like appear on the image.

The email account need to have Exchange Online (Plan 1) license ( this is the key)

on Manage email apps → Allow → Authenticated SMTP**

For security I activated the MFA