【问题标题】:Outlook email - SMTPLIB - Can't send emails [duplicate]Outlook 电子邮件 - SMTPLIB - 无法发送电子邮件 [重复]
【发布时间】:2020-09-19 12:39:31
【问题描述】:

我正在创建一个脚本,该脚本使用我的 Outlook 电子邮件发送电子邮件,该电子邮件具有以下 SMTP 设置:

Servername: smtp.office365.com
Port: 587
Protocol command: STARTTLS

为此,我使用了以下代码:

client = smtplib.SMTP('smtp.office365.com', 587)
client.ehlo()
client.starttls()
client.ehlo()
client.login(user, password)
client.sendmail(msg['From'], emaillist , msg.as_string())
client.close()

我收到以下错误:

(554, b'5.2.0 STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message WASCL UserAction verdict is not None. Actual verdict is HipNotify. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is HipNotify. [Hostname=DB8P191MB0809.EURP191.PROD.OUTLOOK.COM]')

我做错了什么?

【问题讨论】:

  • 在我的情况下,我没有收到任何带有一些说明的自动电子邮件

标签: python outlook smtplib


【解决方案1】:

您的代码看起来不错 - 这是电子邮件服务器错误消息,而不是 Python 异常。出于某种原因(可能是为了阻止自动程序发送垃圾邮件)您的电子邮件主机正在阻止您的电子邮件。

This github thread here 建议您可以通过登录确认您的身份来解决此问题。

【讨论】:

    猜你喜欢
    • 2022-07-20
    • 2021-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-04
    • 2011-02-18
    • 2022-06-29
    • 2010-09-25
    相关资源
    最近更新 更多