SMTPClient Server Error Outlook 5.3.4 5.2.0

I have an MVC.NET web application that has been running stably for most of the year. However, today we received an error code, and I had problems finding a solution to the problem.

In the application, I use SMTPClient to send email. For this we use Outlook email. This has worked to this day. The error code I get is this:

Mailbox not available. Server response: 5.3.4 554-554 5.2.0 STOREDRV.Deliver; delivery 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 webconfig.

, . , ; client.Send(mail);

, , .

  • outlook.live.com.
  • outlook.live.com .
  • smtp.live.com smtp-mail.outlook.com
  • 25 ( ) 465 ( , )
  • EnableSsl false ( , )

SO , . , , .

, Microsoft . 16 . , , . , . , , .

- , ?

+9
3

, :

, :

string from = "email@somwhere.com";

:

string from = "thecorrectemailaddress@outlook.com";

...

MailMessage mail = new MailMessage(from, to);
+10

5.2.0 STOREDEV - SPF . https://en.wikipedia.org/wiki/Sender_Policy_Framework

: email@somwhere.com email@somwhere.com . somwhere.com IP- somwhere.com , , somwhere.com, somwhere.com somwhere.com , , .

, ...@outlook.com outlook, SPF , .

+1

: , emails- 1. "thecorrectemailaddress@outlook.com" 2. "thecorrectemailaddress@hotmail.co.uk" "smtp.live.com " 587. - , 587.

0

Source: https://habr.com/ru/post/1664297/


All Articles