Getting Read/Delivery receipts from SMTPClient mail message?

  • Thread starter Thread starter Scott Townsend
  • Start date Start date
S

Scott Townsend

I'm trying to get a Delivery Receipt from sending a message using the
System.Net.Mail.SMTPClient Class

There seems to be a few ways to do it. You can set the
DeliveryNotificationOptions, or add Headers.

I've tried the following with varying results.
eMail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess
eMail.Headers.Add("Disposition-Notification-To", """" & sEmail_Sender_Name &
""" <" & sEmail_From & ">")
eMail.Headers.Add("Return-Receipt-To", """" & sEmail_Sender_Name & """ <" &
sEmail_From & ">")

I cannot seem to get a receipt for HTML Messages that I send to my Yahoo
Account. The Messages get through fine. I can see the headers and they
look fine too. If I send the message to my local Exchange Server, the
receipts work great.

If I just use the .body to send a Text email, I am able to get a Delivery
Receipt for the Text Message.

Here is how I've Formatted the HTML Message.

Dim htmlType As System.Net.Mime.ContentType = New
System.Net.Mime.ContentType("text/html")
eMail.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(bcEmail_HTML_Body,
htmlType))



Any Suggestions?



Thanks,

Scott<-
 
More info.

Its not specific to HTML I just cant get more then one. I'm just using the:
eMail.DeliveryNotificationOptions =
DeliveryNotificationOptions.OnSuccess

If I send 2 emails in one session, (SSIS Task) I only get the one Delivery
Receipt. If I send the emails one at a time I get one for the Text and one
for the HTML.

Its like it knows it had a receipt from the last time through and is not
asking for another one.???


AARRGG!!!
 
Back
Top