0 votes

Can we create MailBuilder object from MessageData?

by (1.6k points)

1 Answer

+1 vote

MessageData represents eml (MIME) data for specific email message downloaded by IMAP client.

MailBuilder is used to create a new IMail instance, either by parsing eml data -or- by creating new email from scratch.

To obtain IMail having MessageData use:

MessageData messageData = ...;
IMail email = new MailBuilder().CreateFromEml(messageData.EmlData);

If for some reason you want to create MailBuilder from existing IMail use IMail.ToBuilder() - it creates new MailBuilder with all data imported from the original email object. It can be used to create a new email.

by (297k points)
...