Need sample code to Read email with attachments and convert to .eml file using Microsoft Graph API in C#
Microsoft Graph API – 5.49.0 Version
Target Framework – Net 5.0
And please confirm whether am I using compactible versions or not.
var messages = _graphServiceClient.Users[“”].MailFolders[“inbox”].Messages.GetAsync().Result;
foreach (var message in messages.Value)
{
// From the “message” object, Able to retrieve BodyPreview, Subject, From Address and Has Attachments.
}
If **HasAttachments **is **true **and **email **contains **attachment **in the inbox but message.Attachments is null.
Need to know how to retrieve attachments from “message” object.
As well need to convert that email to .eml format and move the email to different folder from “Inbox”