Basic Auth is now disabled in most tenants.
Also, if you're connecting to office 365, the smtp for client submission runs on port 587.
Mailing programatically through Microsoft account
We have created an email in our account (Microsoft) to send mails programmatically. The mail is of the type npreply@...
How can I send mails programmatically, in order to inform the suppliers of the integration of data, with python smtplib.
My code is:
with SMTP(Connection["Server"],Connection["Port"]) as conn:
conn.ehlo()
conn.starttls()
conn.ehlo()
conn.login(Connection["User"],Connection["Password"])
conn.sendmail(Connection["User"],AllAddrs,msg.as_string())
print("Message sent!")
Where Connection["Server"] indicates our MX endpoint and port is 25. User is the noreply@....
This gives error:
line 697, in login
"SMTP AUTH extension not supported by server.")
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
-
Rafael da Rocha 5,251 Reputation points
2022-08-02T11:48:36.173+00:00
1 additional answer
Sort by: Most helpful
-
JDias 136 Reputation points
2022-08-03T15:04:59.443+00:00 So @Rafael da Rocha , what should I do?
Connect through port 587 and run the same sequence of commands?
Where may I find a snippet of code in python (or not)?
Thanks