python instruction smtplib.SMTP("smtp.office365.com", 587) does not return on linux azure VM

Ismi 1 Reputation point
2021-11-26T02:07:21.873+00:00

Hello

I wrote python a script to send an email from an @harsh.com .com email address.
152689-capture1.png

the script works correctly on my windows pc, and on my local virutal linux macchine.
but when i run the same script on linux VM in Azure, the command smtplib.SMTP("smtp.office365.com", 587) never returns.
this is a screenshot of the traceback when I interept the script
152690-capture2.png

Could you please help me to fix this issue?
Thank you.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,615 questions
{count} votes