I want to read my email messages and transform them into json. I am using Microsoft Graph API to query the office 365 mail box like this
GraphServiceClient client = new GraphServiceClient(
new DelegateAuthenticationProvider (
(requestMessage) =>
{
requestMessage.Headers.Authorization =
new AuthenticationHeaderValue("Bearer", token);
return Task.FromResult(0);
}
)
);
var mailResults = await client.Me.MailFolders.Inbox.Messages.Request()
.OrderBy("receivedDateTime DESC")
.Select(m => new { m.Subject, m.ReceivedDateTime, m.From, m.Body})
.Top(100)
.GetAsync();
I followed this tutorial to get to this stage. But my message body is returned as html instead of text. Is there a way I can specify the message.body to return text or even json instead of HTML?