Click here to Skip to main content
16,010,022 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

Here I am developing one desktop application using c# for sending mails. In that I want to add mail read notification. I have used the code below but it is not working. -- any help is greatly appreciated.

Mail is going, but i am not getting any read notification.

C#
using System.Net.Mail;

MailMessage Msg = new MailMessage();
Msg.From =new System.Net.Mail.MailAddress("FromID");
Msg.To.Add("ToId");
Msg.Subject = "hai";
Msg.Body = "sss";
Msg.Headers.Add("Disposition-Notification-To", "ReturnID");
SmtpClient smtp = new SmtpClient("servername",port);

smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("sendingID", "MyPwd","Domain");

smtp.Host = "Hostname";

smtp.Send(Msg);



Thanks
Sujith
Posted
Updated 1-Mar-12 0:13am
v2
Comments
Herman<T>.Instance 1-Mar-12 5:14am    
what is the value of ReturnID? see this for example. You add the correct header, so what emailaddress is ReturnID?
sujithmtla 1-Mar-12 6:04am    
I am using the same code, return ID means return mailid. but its not working
Herman<T>.Instance 1-Mar-12 8:24am    
you should set an emailaddress there
Slacker007 1-Mar-12 6:13am    
Edits: formatting and readability.

1 solution

Read receipts are not directly supported by all email systems and the System.Net.Mail namespace only uses the base functionality. If you want read receipts you'll need to use a system that supports it, like Exchange with Outlook.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900