Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlook SMTPClient server error 5.3.4 5.2.0

I have an MVC .NET web application that has been running stable for the most part of a year now. However today we received an error code and I'm having trouble finding how to resolve the issue.

In the application, I use SMTPClient to send emails out. For this, we use an Outlook email account. This was working fine until today. The error code that I get is this:

Mailbox unavailable. The server response was: 5.3.4 554-554 5.2.0 STOREDRV.Deliver; delivery result banner

Here is the code that I use in my application.

var client = new SmtpClient
{
    Host = WebConfigurationManager.AppSettings["EmailHost"],
    Port = 587,
    EnableSsl = true,
    DeliveryMethod = SmtpDeliveryMethod.Network,
    UseDefaultCredentials = false,
    Credentials = new System.Net.NetworkCredential(WebConfigurationManager.AppSettings["EmailSender"],
    WebConfigurationManager.AppSettings["EmailSenderPassword"])
};

WebConfigurationManager.AppSettings["EmailHost"], is set to smtp.live.com in the webconfig.

After this, I add data and the other information needed of course, but I omitted that. The error is thrown when we arrive at the last part of the code: client.Send(mail);

Things I have tried so far that did not work.

  • Login to the email account on outlook.live.com;
  • Update security settings on outlook.live.com for the email account;
  • Changed smtp.live.com to smtp-mail.outlook.com;
  • Changed the Port to 25 (which gave me the same error) and 465 (Which gave me a server not reached error);
  • Set EnableSsl to false (Client doesn't work when I do that).

I have seen several posts on SO and other websites that are similar or have the same error code. But they either go unanswered or they mark logging in to the email account as the solution, which does not work for me.

When we logged into the email account we got an update notice from Microsoft talking about the new privacy and security update. This was from September 16th. I don't know if there is a three-month time limit within which you need to agree to it. But a week ago the email account has sent an email, and yesterday it failed on sending one. We agreed to the agreement pop up but it is still not working though.

Does anybody have any idea what I can try now or what is causing this error?

like image 732
Robin Avatar asked Dec 20 '16 13:12

Robin


2 Answers

OK, I resolved this issue on my system as follows:

i was sending the message with a different email address to that of the account I was sending from like this:

string from = "[email protected]";

so I changed it to :

string from = "[email protected]";

so now it works fine ... happy days

MailMessage mail = new MailMessage(from, to);
like image 175
Andie Avatar answered Sep 28 '22 13:09

Andie


I have resolved this issue on my system as follows: The from address should be like these below emails- 1. "[email protected]" 2. "[email protected]" Here I am using "smtp.live.com" as server domain and port is 587. If there is any problem with the firewall , you can add a rule in your firewall for the same port 587.

like image 37
arpit rai Avatar answered Sep 28 '22 12:09

arpit rai