0 votes

I don't seem to have this ReadReceiptBuilder, perhaps my version is too old to support it. How do I send read receipts without it?

by
edited by

1 Answer

0 votes

Consider updating your component to the latest version:
https://www.limilabs.com/mail/download

Creating Message Disposition Notification (MDN) is very simple then:

IMail mail = ...

ReadReceiptBuilder mdnBuilder = new ReadReceiptBuilder(mail);
MailBuilder builder = mdnBuilder.WasDisplayed(
    new MailBox("bob@example.com"));
IMail mdn = builder.Create();

https://www.limilabs.com/blog/creating-read-receipt-mdn

It'll be quite hard to create an MDN without ReadReceiptBuilder class.

You'll need to manually create multipart/report object with message/disposition-notification and text/plain representation (use MimeFactory for that).

Report entity must have Final-Recipient and Original-Message-ID filled.
Its Disposition header must be set to appropriate values (action mode, sending mode and type).

Sending mode specifies if the Message Delivery Notification (MDN) was sent manually or automatically. Action mode describes if it was manual or automatic action. Type describes the action itself: Displayed, Deleted.

Remember about setting References header and using appropriate To (in case there is Disposition-Notification-To header on the original email):

From: <bob@example.com>
To: <alice@example.com>
References: <01F8CFFDFE622941929391916AB31A2D0376A7@example.com>
Subject: Read: Test
MIME-Version: 1.0
Content-Type: multipart/report;
    report-type=disposition-notification;
    boundary="----=_NextPart_000_0006_01C38DE0.B3201200"

This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C38DE0.B3201200
Content-Type: text/plain;

This is a receipt for the mail you sent to <bob@example.com> 
This receipt verifies that the message has been displayed.

------=_NextPart_000_0006_01C38DE0.B3201200
Content-Type: message/disposition-notification
Content-Disposition: inline

Final-Recipient: rfc822;bob@example.com>
Original-Message-ID: <01F8CFFDFE622941929391916AB31A2D0376A7@example.com>
Disposition: manual-action/MDN-sent-manually; displayed

------=_NextPart_000_0006_01C38DE0.B3201200--
by (301k points)
I believe I need a current subscription to upgrade, am I correct?
Yes, please contact us directly with your previous purchase id.
...