SmtpMail.ReadReceipt Property


Sets the read receipt request in the email.

[Visual Basic]
Public Property ReadReceipt As Boolean
[C#]
public bool ReadReceipt {get; set;}
[C++]
public: __property bool get_ReadReceipt();
public: __property void set_ReadReceipt(bool);
[JScript]
public function get ReadReceipt() : bool;
public function set ReadReceipt(bool);

If the value is true, a read receipt request will be added to the email message.

Read Receipt

Some e-mail applications, such as Microsoft Office Outlook, employ a read-receipt tracking mechanism. A sender selects the receipt request option prior to sending the message. Upon opening the email, each recipient has the option of notifying the sender that the message was opened and read.

The following example codes demonstrate how to request read receipt and delivery receipt:

[C#]
// The following example codes demonstrate requesting read receipt and delivery receipt
// To get full sample projects, please download and install EASendMail on your machine.
// To run it correctly, please change SMTP server, user, password, sender, recipient value to yours

using System;  
using System.Text; 
using EASendMail; 

void SendMail()
{
    try
    {
        SmtpMail oMail = new SmtpMail("TryIt");
        // Set sender email address, please change it to yours
        oMail.From = "test@emailarchitect.net";
        // Set recipient email address, please change it to yours
        oMail.To = "support@emailarchitect.net";

        // Set email subject
        oMail.Subject = "test email from c# project";
        // Set email body
        oMail.TextBody = "this is a test email sent from c# project, do not reply";

        // Request read receipt
        oMail.ReadReceipt = true;

        // Request both failure and success report
        oMail.DeliveryNotification = DeliveryNotificationOptions.OnFailure |
            DeliveryNotificationOptions.OnSuccess;

        // Your SMTP server address
        SmtpServer oServer = new SmtpServer("smtp.emailarchitect.net");

        // User and password for ESMTP authentication
        oServer.User = "test@emailarchitect.net";
        oServer.Password = "testpassword";

        // Most mordern SMTP servers require SSL/TLS connection now.
        // ConnectTryTLS means if server supports SSL/TLS, SSL/TLS will be used automatically.
        oServer.ConnectType = SmtpConnectType.ConnectTryTLS;

        SmtpClient oSmtp = new SmtpClient();
        oSmtp.SendMail(oServer, oMail);

        Console.WriteLine("email was sent successfully!");
    }
    catch (Exception ep)
    {
        Console.WriteLine("failed to send email {0}", ep.Message);
    }
}


[VB] ' The following example codes demonstrate requesting read receipt and delivery receipt ' To get full sample projects, please download and install EASendMail on your machine. ' To run it correctly, please change SMTP server, user, password, sender, recipient value to yours Imports EASendMail Sub SendMail() Try Dim oMail As New SmtpMail("TryIt") ' Set sender email address, please change it to yours oMail.From = "test@emailarchitect.net" ' Set recipient email address, please change it to yours oMail.To = "support@emailarchitect.net" ' Set email subject oMail.Subject = "test email from VB.NET project" ' Set email body oMail.TextBody = "this is a test email sent from VB.NET project, do not reply" ' Your SMTP server address Dim oServer As New SmtpServer("smtp.emailarchitect.net") ' User and password for ESMTP authentication oServer.User = "test@emailarchitect.net" oServer.Password = "testpassword" ' Most mordern SMTP servers require SSL/TLS connection now. ' ConnectTryTLS means if server supports SSL/TLS, SSL/TLS will be used automatically. oServer.ConnectType = SmtpConnectType.ConnectTryTLS ' Request read receipt oMail.ReadReceipt = True ' Request both failure and success report oMail.DeliveryNotification = DeliveryNotificationOptions.OnFailure Or DeliveryNotificationOptions.OnSuccess Dim oSmtp As New SmtpClient() oSmtp.SendMail(oServer, oMail) Console.WriteLine("email was sent successfully!") Catch ep As Exception Console.WriteLine("failed to send email {0}", ep.Message) End Try End Sub

See Also

Process Bounced Email (Non-Delivery Report) and Email Tracking