我想通过使用Python 3发送电子邮件。我还没有理解我见过的例子。这里有一个参考:Python 3 |发送电子邮件 - SMTP - Gmail - 错误:SMTPException
我拉了上面的参考找到第一个简单的例子。我发现这个例子很好地代表了我在互联网上看到的例子的组合。这似乎是我正在做的事情的基本形式。
当我尝试下面的代码,我收到错误:
File "C:\Python33\Lib\email.py", line 595, in login
raise SMTPException("SMTP AUTH extension not supported by server.")
smtplib.SMTPException: SMTP AUTH extension not supported by server.
下面是代码:
# Send Mail
import smtplib
server = smtplib.SMTP('smtp.gmail.com', 587)
# Log in to the server
server.login("[email protected]","myPassword")
# Send mail
msg = "\nHello!"
server.sendmail("[email protected]","[email protected]", msg)