Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending mail with delivery receipt?

Tags:

c#

asp.net

I use a function that sends emails to some users.

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

when a message fails to reach the user.

I use the following code.

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

now I want to enable the sender to receive a Delivered receipt message when the mail arrives successfully.

how can this be done ?

thanks

like image 967
Mina Wissa Avatar asked Mar 29 '10 15:03

Mina Wissa


1 Answers

MailMessage has a DeliveryNotificationOptions property, set it like this:

messagetest .DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess;

There are a few other options as well if you need them.

like image 158
Nick Craver Avatar answered Sep 22 '22 01:09

Nick Craver