Email Delivery Receipt from ASP.Net page

Hello Everyone and thanks for your help in advance.  I am working on a web form that sends an email.  I need to be able to obtain some type of delivery receipt or status.  I have tried the following code:

message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess

But when the email is sent (I am sending it to my Exchange server for testing), no delivery receipt is returned.  Everything else seems to work fine.  Any help would be appreciated.

@kmcnet

Usually there will be prompt from the user end to send the Delivery Notification. Is it prompting that for you?

I don't think the delivery receipt requires a prompt from the user.  However, the read receipt does and it does prompt the user to confirm it was read.

Hi,

It is hard to say what is the main issue according to your description. Please check the demo below about how to send messages about both successfully sent and failed emails to the sender's email address.

MailMessage msg = new MailMessage();
msg.From = "sender@sender.com";
msg.To = "receiver@receiver.com";
msg.Subject = "the subject of the message";
// Set delivery notifications for success and failed messages
msg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess | DeliveryNotificationOptions.OnFailure;
// Add the MIME headers
msg.Headers.Add_(new MimeHeader("Read-Receipt-To", "sender@sender.com"));
msg.Headers.Add_(new MimeHeader("Disposition-Notification-To", "sender@sender.com"));
SmtpClient client = new SmtpClient("host", "username", "password");
client.Send(msg);

In addition, please add the reference as follows: 

using System.Net;

Best wishes,

Thanks for the response.  Here is what the email headers look like:

Microsoft Mail Internet Headers Version 2.0
Received: from MY-PC ([server IP]) by mail.mydomain.com with Microsoft SMTPSVC(6.0.3790.4675);
         Mon, 27 Aug 2012 21:02:41 -0400
Disposition-Notification-To: sender@mydomain.com
Return-Receipt-To: sender@mydomain.com
MIME-Version: 1.0
From: "Sender Display Name"
 <sender@mydomain.com>
To: "Receiver Display Name"
 <receiver@mydomain.com>
X-Priority: 1
Priority: urgent
Importance: high
Date: 27 Aug 2012 21:10:51 -0400
Subject: Subject
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Return-Path: sender@mail.mydomain.com
Message-ID: <SERVER5K6qHN1gHrQ5Ne0000788a@mail.mydomain.com>
X-OriginalArrivalTime: 28 Aug 2012 01:02:41.0671 (UTC) FILETIME=[D340F170:01CD84B8]


So it appears to be correctly sent.  I'm wondering if it might be my mail server, but it works fine with Outlook.

1 thoughts on "Email Delivery Receipt from ASP.Net page"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>