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:
Import Notice: Not every SMTP server support Delivery Receipt. Only the SMTP server that supports DSN extension command accepts Delivery Receipient request, otherwise you will get error when you are sending email.
[C# - Send Email from Windows Store Apps - XAML] // 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 EASendMail; using System.Threading.Tasks; private async Task SendEmail() { String Result = ""; try { SmtpMail oMail = new SmtpMail("TryIt"); SmtpClient oSmtp = new SmtpClient(); // Request read receipt oMail.ReadReceipt = true; // Request both failure and success report oMail.DeliveryNotification = DeliveryNotificationOptions.OnFailure | DeliveryNotificationOptions.OnSuccess; // Set sender email address, please change it to yours oMail.From = new MailAddress("test@emailarchitect.net"); // Set email subject oMail.Subject = "test email from C# XAML project"; // Set email body oMail.TextBody = "this is a test email sent from Windows Store App, do not reply"; // 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"; // If your SMTP server requires TLS connection on 25 port, please add this line // oServer.ConnectType = SmtpConnectType.ConnectSSLAuto; // If your SMTP server requires SSL connection on 465 port, please add this line // oServer.Port = 465; // oServer.ConnectType = SmtpConnectType.ConnectSSLAuto; await oSmtp.SendMailAsync(oServer, oMail); Result = "Email was sent successfully!"; } catch (Exception ep) { Result = String.Format("Failed to send email with the following error: {0}", ep.Message); } // Display Result by Diaglog box Windows.UI.Popups.MessageDialog dlg = new Windows.UI.Popups.MessageDialog(Result); await dlg.ShowAsync(); } [VB - Send Email from Windows Store Apps - XAML] ' 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 Private Async Function SendEmail() As Task Dim Result As String = "" Try Dim oMail As New SmtpMail("TryIt") Dim oSmtp As New SmtpClient() ' Request read receipt oMail.ReadReceipt = True ' Request both failure and success report oMail.DeliveryNotification = DeliveryNotificationOptions.OnFailure Or _ DeliveryNotificationOptions.OnSuccess ' Set sender email address, please change it to yours oMail.From = New MailAddress("test@emailarchitect.net") ' Set email subject oMail.Subject = "test email from VB XAML project" ' Set email body oMail.TextBody = "this is a test email sent from Windows Store App, 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" ' If your SMTP server requires TLS connection on 25 port, please add this line ' oServer.ConnectType = SmtpConnectType.ConnectSSLAuto ' If your SMTP server requires SSL connection on 465 port, please add this line ' oServer.Port = 465 ' oServer.ConnectType = SmtpConnectType.ConnectSSLAuto Await oSmtp.SendMailAsync(oServer, oMail) Result = "Email was sent successfully!" Catch ep As Exception Result = String.Format("Failed to send email with the following error: {0}", ep.Message) End Try ' Display Result by Diaglog box Dim dlg As New Windows.UI.Popups.MessageDialog(Result) Await dlg.ShowAsync() End Function [JavaScript - Send Email from Windows Store Apps - HTML5] // 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 function sendMail() { var result = ""; var oMail = new EASendMail.SmtpMail("TryIt"); var oSmtp = new EASendMail.SmtpClient(); // Request read receipt oMail.readReceipt = true; // Request both failure and success report oMail.deliveryNotification = EASendMail.DeliveryNotificationOptions.onFailure | EASendMail.DeliveryNotificationOptions.onSuccess; // Set sender email address, please change it to yours oMail.from = new EASendMail.MailAddress("test@emailarchitect.net"); // Set email subject oMail.subject = "test email from JavaScript HTML5 project"; // Set email body oMail.textBody = "this is a test email sent from Windows Store App, do not reply"; // Your SMTP server address var oServer = new EASendMail.SmtpServer("smtp.emailarchitect.net"); // User and password for ESMTP authentication oServer.user = "test@emailarchitect.net"; oServer.password = "testpassword"; // If your SMTP server requires TLS connection on 25 port, please add this line // oServer.connectType = EASendMail.SmtpConnectType.connectSSLAuto; // If your SMTP server requires SSL connection on 465 port, please add this line // oServer.port = 465; // oServer.connectType = EASendMail.SmtpConnectType.connectSSLAuto; oSmtp.sendMailAsync(oServer, oMail).then(function (e) { result = "Email was sent successfully!"; // Display Result by Diaglog box (new Windows.UI.Popups.MessageDialog(result, "Success")).showAsync(); }, function (e) { // because javascript exception only gives the stack trace messages, but it is not // real description of exception, so we give a property lastErrorMessage for javascript. if (oSmtp.lastErrorMessage != "") { result = oSmtp.lastErrorMessage; } else { result = e.message; } oSmtp.close(); // Display Result by Diaglog box (new Windows.UI.Popups.MessageDialog(result, "Error Information")).showAsync(); }); }
See Also