ComponentPro UltimateMail

Creating a message that has read receipt request

Language Filter: AllSend comments on this topic to ComponentPro

It is often needed to make sure recipients received your email. This task can easily be done by adding addresses that will receive the notification to your message using the Headers property of the MailMessage class.

The following code example illustrates how to do that:

using System;
using ComponentPro.Net.Mail;

...

// Create a new instance of the MailMessage class.
MailMessage msg = new MailMessage();

msg.From.Add("john@somedomain.com");
msg.To.Add("someone@somedomain.com");
msg.Subject = "Hello";
msg.BodyText = "How are you?";
msg.Headers.Add("Disposition-Notification-To", "john@somedomain.com");

// And Send it
Smtp client = new Smtp();

// Connect and authenticate to your server here. 
 
// ...
client.Send(msg);

// ...