Sending mail with a delivery receipt?

I use a function that sends emails to some users.

I use the following code to send delivery notification error messages to an email sender

when the message does not reach the user.

I am using the following code.

System.Web.Mail.MailMessage messagetest = new System.Web.Mail.MailMessage(); messagetest.Headers.Add("Disposition-Notification-To", txtFrom.Text); 

Now I want the sender to receive a receipt delivery message when the mail arrives successfully.

How can I do that?

thanks

+6
source share
1 answer

MailMessage has the DeliveryNotificationOptions property, set it as follows:

 messagetest .DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess; 

There are other options if you need them.

+9
source share

All Articles