Failing to send email with the Python example

后端 未结 10 950
南旧
南旧 2020-12-04 15:56

I\'ve been trying (and failing) to figure out how to send email via Python.

Trying the example from here: http://docs.python.org/library/smtplib.html#smtplib.SMTP

10条回答
  •  星月不相逢
    2020-12-04 16:24

    You should check your port, I'm not sure that google's SMTP port is 65, that would explain the timeout.

    Modify your sources as such:

    smtplib.SMTP_SSL('smtp.google.com', 465)

    If, however, you are certain that it ought to work and it doesn't, it appears that there are some problems with smtplib.SMTP_SSL, and there's an available patch for it here.

提交回复
热议问题