I have some problem with Microsoft Graph.I would like to download the attachments present in a specific email. I have verified that the type of object returned after this:
var attachments = graphClient.Me.Messages[msg.Id].Attachments.Request().GetAsync().Result;
foreach(var item in attachments) {
var current_attachment = graphClient.Me.Messages[msg.Id].Attachments[item.Id].Request().GetAsync().Result;
}
is an object of type Attachment. Now, I would like to download this object (current_attachment) but I saw that the property ContentBytes isn't available. I have tried to cast the object to FileAttachment, but it throw an exception.
Thank you.
This should be fairly straightforward. Specifically:
Here is an example:
You can write "stream" to a disk file like this:
The resulting .eml file will be the complete email, including all attachments.