SMTP Relay configuration for Outlook 2FA to send mail from python script

Viewed 1769

I am trying to write a python script which will send mails from Office 365 account which has 2 Factor Authentication. with smtp.office365.com,587 it does not work because of the 2FA.

host = yourdomain-com.mail.protection.outlook.com Port = 25 should be used as per the below link

https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-office-3

but I am unable to configure the settings mentioned in the link as I am getting the below error

You don’t have permission to access this page or perform this action. CloseSupport Information Correlation ID:sea#4d1521bd-d123-488f-9a37-fbf34425f13b Error code:0

Is there any other way to login and send mails from Office 365 account having 2 Factor Authentication?

0 Answers
Related