Failing to send email with the Python example

后端 未结 10 951
南旧
南旧 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:44

    The problem is due to a bug in Python. Trying to create a connection with SMTP_SSL will fail with "SMTPServerDisconnected: please run connect() first."

    A fix has been committed, so you can patch your local copy. See the attachment named "smtplib_72551.diff".

    (Note: SMTP_SSL is a new class added to Python 2.6/3.0 and later.)

提交回复
热议问题