似乎是python3.7 错误,请将主机名传递给smtplib.SMTP会解决此问题
smtp = smtplib.SMTP('smtp.gmail.com') smtp.connect('smtp.gmail.com','587')