galp77
June 12, 2023, 9:38pm
1
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.
Amala4
September 14, 2023, 7:36pm
4
Did you solve this, I have the same issue
Did anyone find a solution on how to sent email using office 365?
all my settings and views are well updated but I kept running into this error
[Errno 101] Network is unreachable
I have stable internet, on office 365 dashboard, authenticated SMTP has been enabled for this email
I don’t know what other setting is missing here to cause above error
galp77
April 29, 2024, 2:25pm
7
I got the solution.
Go to Office 356 make an account
After that go to Licenses and app, after that add this license ( Exchange Online (Plan 1) license )
Go to Mail and go to Manage email app, put the check mark on: Authenticated SMTP
Set up your account in Django settings.py
#OFFICE 365
EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’
EMAIL_HOST = ‘smtp-mail.outlook.com ’
EMAIL_PORT = ‘587’
EMAIL_USE_TLS = True
EMAIL_HOST_USER = ‘your_account@domain.com’ #the email account need to have Exchange Online (Plan 1) license
EMAIL_HOST_PASSWORD = ‘your_password’
DEFAULT_FROM_EMAIL = ‘your_account@domain.com’
galp77:
Exchange Online (Plan 1)
I am having the same issue. I bought my domain from GoDaddy.com and also bought their email service which is using the office 365. The email service comes with the Exchange App, which always takes me to the Exchange admin center. Under Settings > Mail Flow I uncheck the box “Turn off SMTP AUTH protocol for your organization”.
I’ve also have my settings as the following:
EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’
EMAIL_HOST = ‘smtp-mail.outlook.com ’
EMAIL_PORT = ‘587’
EMAIL_USE_TLS = True
EMAIL_HOST_USER = ‘your_account@domain.com’
EMAIL_HOST_PASSWORD = ‘your_password’
DEFAULT_FROM_EMAIL = ‘your_account@domain.com’
I wasn’t able to get it to work, or send emails successfully. I was getting a "“POST /sign-in/ HTTP/1.1” 500 145 " Error.
Any ideas?