Python: when sending email, always blocked in the clause: smtpserver = smtplib.SMTP(“smtp.gmail.com”,587)

前端 未结 4 1945
轮回少年
轮回少年 2021-01-19 08:40

I am writing a Python program to send an email. But every time when executing the clause:

smtpserver = smtplib.SMTP(\"smtp.gmail.com\",587)

4条回答
  •  无人共我
    2021-01-19 09:13

    Maybe I am 4 years late, but this is what worked for me and might help someone else!

    server = smtplib.SMTP("smtp.gmail.com", 587, None, 30)
    

提交回复
热议问题