Processing a read receipt (MDN)

You can also read how to:

In this article we’ll show how to process a read receipt.

Read receipts also known as MDNs or Message Delivery Notifications are used to notify the message sender that some action has happened with their message (it was displayed, processed, deleted)

All MDNs for a received message are available through IMail.ReadReceipts property.

// C#

var eml = imap.GetMessageByUID(uid);
IMail email = new MailBuilder().CreateFromEml(eml);
MimeMessageDispositionNotification mdn = email.ReadReceipts[0];

string finalRecipient = mdn.FinalRecipient; 
      // recipient@example.com

DispositonActionMode actionmode = mdn.ActionMode; 
      // e.g. DispositonActionMode.ManualAction

DispositonSendingMode sendingMode = mdn.SendingMode; 
      // e.g. DispositonSendingMode.SentManually

string originalMessageID= mdn.OriginalMessageID; 
      // e.g. "message-id@original.com"

DispositonType dispositionType = mdn.Type; 
      // e.g. DispositonType.Displayed, DispositonType.Deleted
' VB.NET

Dim eml = imap.GetMessageByUID(uid)
Dim email As IMail = New MailBuilder().CreateFromEml(eml)
Dim mdn As MimeMessageDispositionNotification = email.ReadReceipts(0)

Dim finalRecipient As String = mdn.FinalRecipient 
     ' recipient@example.com

Dim actionmode As DispositonActionMode = mdn.ActionMode 
      ' e.g. DispositonActionMode.ManualAction

Dim sendingMode As DispositonSendingMode = mdn.SendingMode 
      ' e.g. DispositonSendingMode.SentManually

Dim originalMessageID As String = mdn.OriginalMessageID 
      ' e.g. "message-id@original.com"

Dim dispositionType As DispositonType = mdn.Type 
      ' e.g. DispositonType.Displayed, DispositonType.Deleted

Tags: , , ,

Questions?

Consider using our Q&A forum for asking any questions.