19

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

}
2
  • Are you authenticating with SSL correctly? Also I have heard about Outlook being picky about automated mails sent out with a free account. I would recommend using something else entirely
    – Tom F
    Feb 14, 2018 at 2:36
  • @Igneous01 So I'm having the same issue with nodemailer. I've already confirmed the e-mail with outlook, and although the e-mail sends, I'm still getting this error. I checked my inbox after reading your post, and I don't see a new confirmation email from outlook. Do you know if there have been any changes in outlooks policy? Jul 17, 2021 at 0:12

2 Answers 2

33

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.

1
  • 4
    Fwiw, I've had to verify twice -- the first time let me send messages programmatically at all, then a few days later while developing I hit some sort of limit and received the OutboundSpamException described here and had to verify again (the same phone number worked). A little worried Outlook isn't going to like sending out lots of confirmation emails for website registrations, aka "when does the verification requirement end"? Expected ShowTierUpgrade to mean I got upsold to something to enable sending lots of email, but it was just re-verification. /shrug
    – ruffin
    Jan 10, 2020 at 20:59
0

Got this error trying to send lots of emails to myself at Outlook.com, using SMTP.

To fix it I simply added a 5 second delay between the sends, for example:

foreach(var mail in mailToSend)
{
    await smtpClient.SendMailAsync(mail);
    Console.WriteLine("Sent email: " + mail);
    await Task.Delay(5000);
}

If you aren't doing this just as a test, then you can contact the Outlook.com team and ask them to whitelist your IP (make sure you have SPF, rDNS, etc. setup first).

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.