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

2024-04-29 05:55:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在写一个小的实用程序来帮助处理一些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;
    }

}

Tags: tofromsslnewstringisuseport
1条回答
网友
1楼 · 发布于 2024-04-29 05:55:58

我通过验证试图使用的帐户解决了这个问题。每次遇到此错误时,都会向帐户发送一封电子邮件,其中说明了解决此错误所需执行的操作。通常,您需要根据电话号码进行验证。

相关问题 更多 >