I have written a very basic python code to send email and it works on my local Windows 10 machine however doesn't work on another machine which has Windows Server 2012. So I started investigating and identified that the code is not going past smtplib.SMTP('smtp.office365.com', 587) line. Next I tried on command line by typing below -
import smtplib
s = smtplib.SMTP('smtp.office365.com', 587)
and it never goes to the next line and freezes.... waited for more than 15 mins
To ensure that 587 port is not blocked, I did below on admin command prompt -
telnet smtp.office365.com 587
and it returns back with blank screen without any errors so I am assuming that firewall is NOT blocking the incoming port.
I am testing on Python version 3.8.5
I am stuck at this point and searched all over the place but couldn't find any solution.
Any help is greatly appreciated. Thank you.