+2 votes

hi is there any way to check if an email is a read receipt and not a normal email?

by

1 Answer

0 votes

You need to check the count on IMail.ReadReceipts collections. If it's greater then zero email contains read receipt:

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; 
      // DispositonActionMode.ManualAction

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

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

DispositonType dispositionType = mdn.Type; 
      // DispositonType.Displayed, DispositonType.Deleted

Processing a read receipt (MDN):
https://www.limilabs.com/blog/processing-read-receipt-mdn

by (301k points)
...