I am downloading messages over IMAP using MailFolder.Fetch and then getting the relevant body parts with MailFolder.GetBodyPart.
Is it possible to get the raw representation of the MIME message in addition to the processed information?
Code:
var query = CreateSearchQuery(startDate, endDate);
await mailFolder.OpenAsync(FolderAccess.ReadOnly);
var results = await mailFolder.SearchAsync(SearchOptions.All, query);
var messageSummaries = await mailFolder.FetchAsync(results.UniqueIds, DownloadFlags);
Later I download the message by running over the parts, finding the html and the plain parts and downloading them as shown in this question (only I download the parts that are not IsAttachment==true
).