Python SMTP 电子邮件未到达收件人
Python SMTP Email not reaching recipent
我正在尝试 运行 一个在 python 3.5 中使用 smtplib 发送电子邮件的程序,但它不工作。正在发送电子邮件,收件人在他们的收件箱中看到一封电子邮件,但它是空的(邮件内容不存在)。代码看起来有点像这样:
message = "Test Message"
server = smtplib.SMTP("smtp.live.com", 25)
server.starttls()
server.login("someone@hotmail.com", "someones_password")
server.sendmail("someone@hotmail.com", someone_else@somewhere.com, message)
谁能告诉我哪里做错了?
您是否尝试在 server.starttls()
之前使用 server.ehlo()
?
像这样:
message = "Test Message"
server = smtplib.SMTP("smtp.live.com", 25)
server.ehlo()
server.starttls()
server.login("someone@hotmail.com", "someones_password")
server.sendmail("someone@hotmail.com", someone_else@somewhere.com, message)
我正在尝试 运行 一个在 python 3.5 中使用 smtplib 发送电子邮件的程序,但它不工作。正在发送电子邮件,收件人在他们的收件箱中看到一封电子邮件,但它是空的(邮件内容不存在)。代码看起来有点像这样:
message = "Test Message"
server = smtplib.SMTP("smtp.live.com", 25)
server.starttls()
server.login("someone@hotmail.com", "someones_password")
server.sendmail("someone@hotmail.com", someone_else@somewhere.com, message)
谁能告诉我哪里做错了?
您是否尝试在 server.starttls()
之前使用 server.ehlo()
?
像这样:
message = "Test Message"
server = smtplib.SMTP("smtp.live.com", 25)
server.ehlo()
server.starttls()
server.login("someone@hotmail.com", "someones_password")
server.sendmail("someone@hotmail.com", someone_else@somewhere.com, message)