Unable to login through SMTP AUTH port 587

Hello,

I am trying to connect a python script to an account, but till now, I am only receiving this response from server side:

smtplib.SMTPAuthenticationError: (535, '5.7.3 Authentication unsuccessful [CH2PR16CA0021.namprd16.prod.outlook.com]')

With this script:


import smtplib

SERVER = "smtp.office365.com"
PORT = 587

PASS = ""
FROM = ""
TO = ""
MSG = "testing..."

server = smtplib.SMTP(SERVER, PORT, timeout=20)

#server.ehlo()

server.starttls()

server.login(FROM, PASS)

server.sendmail(FROM, TO, MSG)

server.quit()


From Admin console at office 365, Enable Security defaults are disabled, and from user the user account, SMTP AUTH is enabled.

I really dont know why its still not working.

Anyone knows?

Hi Sir,

Please allow us sir if you are using scripting or any programming and having this kind of issue, since we have specific team that focus on this field, sir you can kindly post your question at the https://github.community/ and we have engineers to answer your question.

Kind Regards,

George

------------------------
* Beware of scammers posting fake support numbers here.

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 23, 2022 Views 388 Applies to: