Python: when sending email, always blocked in the clause: smtpserver = smtplib.SMTP(“smtp.gmail.com”,587)
问题 I am writing a Python program to send an email. But every time when executing the clause: smtpserver = smtplib.SMTP("smtp.gmail.com",587) it will block here and always stay the executing status without any prompts and errors. I don't know why. And can anyone help me? The code is as following: import smtplib to = 'toemail@gmail.com' gmail_user = 'user@gmail.com' gmail_pwd = 'password' smtpserver = smtplib.SMTP("smtp.gmail.com",587) smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo