Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - Sending Email - STOREDRV.Submission.Exception:OutboundSpamException

Tags:

c#

smtp

outlook

I am writing a small utility to help process some MySQL tasks every night and have it email my personal email if it fails (this is a personal project, so no company smtp server or anything, emails going through public outlook accounts).

I tested about 5 times and each send was successful, but now any attempts to send email I get this exception:

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]

A bit of an oops on my part - didn't think Outlook would consider it as spam on the 6th try - is there anything I can do in Outlook to correct this?

I am using a service account I created in outlook to send these emails to my personal inbox.

The actual code in question:

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;
    }

}
like image 318
Igneous01 Avatar asked Feb 14 '18 02:02

Igneous01


1 Answers

I resolved this by verifying the account I was trying to use. Each time you encounter this error an email is sent to the account with instructions on what you need to do to resolve the error. Typically you will need to verify against a phone number.

like image 143
user2565663 Avatar answered Oct 03 '22 17:10

user2565663