To request a read receipt, click the Request a Read Receipt for This Message check box to select it. SmtpClient smtp = new SmtpClient("192.168.1. - To request a delivery receipt, click the Request a Delivery Receipt for This Message check box to select it. fails to delivered you'll get notification for both the cases You can use also use OnFailure enum with OnSuccess enum.
and can be used to set the delivery notification on the following options: DeliveryNotificationOption is an enumeration ("Return-Receipt-To", this if you need an delivery notification of an email. Mail.Body = "this is the body content of the email."
#How to request read receipt in outlook 2015 code
Here is the complete listing of the code : Get SMTP to authenticate the credentialsĪs I mentioned earlier also I have tested the above code with Exchange server only and it works perfectly. NetworkCredential netCredit = new "pass#word1", "DOMAIN_NAME") Set the user network/domain credentials You can also set the hostname instead of IP Address When you set the headers for requesting delivery and read receipt, set the mail server and login credentials for the domain or for the e-mail service you use and then in the end call the Send method to send the e-mail. Add "Disposition-Notification-To" for Read receipt Mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess delivered you'll get notification for both the cases You can use also use OnFailure enum with OnSuccess enum. DeliveryNotificationOption is an //umeration and can be used to set the delivery notification on the following options: ("Return-Receipt-To", this if you need a delivery notification of an email. Here I have also commented the deprecated method which is used in the previous version of. As usual I first want to get notified for the e-mail I have sent has been delivered or not and then I want to get notified when my e-mail has been read by the recipient. Now we have to set the Header property of the mail message class to request read/delivery recipt.
Mail.From = new //set the content mail.Subject = "This is an email" mail.Body = "this is the body content of the email." Initialize MailMessage class and set To, From, Subject and Body parameters So let’s see what the code has:įirst we need the namespace to use MailMessage class. I have test the below code with Microsoft Exchange Server and it works perfectly fine. We set a mail header while sending mail from code which is then processed by the mail server and the sender of the mail gets the intended response. But the problem is not every mail server supports this kind of request from the code. When we send e-mail through code we can request a delivery notification and read receipt from the receiver, similar to the way we do in outlook. Scroll down to the Tracking section, and click the checkbox under For all messages sent, request: Delivery receipt confirming the message was delivered to the recipient’s email server and/or Read receipt confirming the recipient viewed the message.Sending e-mail through code is easy, but how do we get to know that an e-mail that we send is delivered and read by the intended recipient.In the Tracking section, click the checkbox for Request a Delivery Receipt and/or Request a Read Receipt.From your new email, click the Options tab.In Outlook 2013/2016 To apply to a single message: Click the checkbox for Request a delivery receipt and/or Request a read receipt.The recipient has the option of declining the sending of receipts, and not all email programs support delivery and read receipts, so it’s best to use these only when necessary and when you know the recipient has the capability of sending receipts–like when your recipient is a colleague and you’re both using Outlook with Exchange. Delivery receipts will indicate that your email was or wasn’t delivered to the recipient’s mailbox it will show you that the message reached their email server, but doesn’t necessarily mean it’s in the user’s inbox. Read receipts will indicate whether the email was opened, and are sent directly from the user who opens the email. The difference between delivery receipts and read receipts The video above shows these methods, and you can also find instructions below. Outlook provides the capability to track emails and get delivery and read receipts for all emails you send and for single messages. But if you have an important message it can be useful to know whether the message has been delivered and/or read. If we get a response, that usually suffices. Most of us spend our days firing off emails without much consideration for how or when they are delivered.