C# - 发送电子邮件 - STOREDRV.Submission.Exception:OutboundSpamException

时间:2018-02-14 02:14:10

标签: c# outlook smtp

我正在编写一个小工具来帮助每晚处理一些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;
    }

}

1 个答案:

答案 0 :(得分:3)

我通过验证要使用的帐户来解决此问题。每次遇到此错误时,都会向该帐户发送一封电子邮件,其中包含有关解决该错误所需的说明。通常,您需要根据电话号码进行验证。