如何使用Python发送以Gmail为提供者的电子邮件?我试图使用python发送电子邮件(Gmail),但是我收到了以下错误。Traceback (most recent call last): File "emailSend.py", line 14, in <module> server.login(username,password) File "/usr/lib/python2.5/smtplib.py", line 554, in login
raise SMTPException("SMTP AUTH extension not supported by server.") smtplib.SMTPException: SMTP AUTH extension not supported by server.Python脚本如下所示。import smtplib
fromaddr = 'user_me@gmail.com'toaddrs = 'user_you@gmail.com'msg = 'Why,Oh why!'username = 'user_me@gmail.com'password = 'pwd'server = smtplib.SMTP('smtp.gmail.com:587')server.starttls()server.login(username,password)server.sendmail(fromaddr, toaddrs, msg)server.quit()
添加回答
举报
0/150
提交
取消