开发者

Sending mail with delivery receipt?

开发者 https://www.devze.com 2022-12-24 06:58 出处:网络
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

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消