How to find out if I send an email successfully using System.Net.Mail

I am using C # to send email using System.Net.Mail.

But how do you know if a message has been sent or not sent successfully?

+3
source share
5 answers

Not a direct answer, but here is a great article from Coding Horror about sending emails through code that solves your question.

+5
source

The simple answer is: if it is a detected failure, it will SmtpClient.Sendthrow a SmtpFailedRecipientsException (it will throw a SmtpException if there is a connection problem).

, . , SMTP- ( iis ) , SMTP- .

, " " . , , , (, ).

. , , , , .

+4

, , . , - .., , ​​ ( : ).

+2

, , , , . , NDR ( ), ,

+1

, , , , . , . SMTP , , , ndr, , . , , - html . -, URL- . , , URL , , , .

+1
source

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


All Articles