【发布时间】:2018-07-24 12:33:09
【问题描述】:
我正在编写一个小实用程序来帮助每晚处理一些 MySQL 任务,如果它失败,它会通过电子邮件发送我的个人电子邮件(这是一个个人项目,所以没有公司 smtp 服务器或任何东西,电子邮件通过公共 Outlook 帐户)。
我测试了大约 5 次,每次发送都成功,但现在任何发送电子邮件的尝试都会出现此异常:
Error sending test email: Transaction failed. The server response was: 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 Suspend, ShowTierUpgrade. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is Suspend, ShowTierUpgrade.[Hostname=BY2PR0101MB1461.prod.exchangelabs.com]
我有点不好意思 - 没想到 Outlook 在第 6 次尝试时会将其视为垃圾邮件 - 我可以在 Outlook 中做些什么来纠正这个问题?
我正在使用我在 Outlook 中创建的服务帐户将这些电子邮件发送到我的个人收件箱。
有问题的实际代码:
class JobMailer
{
private string email_to;
private string email_from;
private string password;
private string email_smtp;
private bool use_ssl;
private int port;
public void Send(string subject, string body)
{
MailMessage mail = new MailMessage(email_from, email_to);
using (SmtpClient client = new SmtpClient
{
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
EnableSsl = use_ssl,
Host = email_smtp,
Timeout = 100000,
Port = port,
Credentials = new NetworkCredential(email_from, password)
})
{
mail.Subject = subject;
mail.Body = body;
client.Send(mail);
}
}
public JobMailer(string emailTo, string smtp, string emailFrom, string pw, int p, bool ssl)
{
email_to = emailTo;
email_from = emailFrom;
password = pw;
email_smtp = smtp;
port = p;
use_ssl = ssl;
}
}
【问题讨论】:
-
您是否正确使用 SSL 进行身份验证?我还听说 Outlook 对使用免费帐户发送的自动邮件很挑剔。我建议完全使用其他东西
-
@Igneous01 所以我在使用 nodemailer 时遇到了同样的问题。我已经用outlook确认了电子邮件,虽然电子邮件发送了,但我仍然收到此错误。阅读您的帖子后,我检查了收件箱,但没有看到来自 Outlook 的新确认电子邮件。您知道前景政策是否有任何变化?