Microsoft Graph SDK
A Microsoft software developer kit designed to simplify building high-quality, efficient, and resilient applications that access Microsoft Graph.
737 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
I am using below code to access mail file attachments. I have two questions;
Thanks
Regards
var inboxMessages = await graphClient
.Users[user.Id]
.MailFolders.Inbox
.Messages
.Request()
.GetAsync();
foreach(Microsoft.Graph.Message message in inboxMessages) {
if (message.HasAttachments == true) {
var attachments = await graphClient
.Users[user.Id]
.Messages[$ "{message.Id}"]
.Attachments
.Request()
.GetAsync();
foreach(var attachment in attachments) {
if (attachment is FileAttachment) {
FileAttachment fileAttachment = attachment as FileAttachment;
//Save fileAttachment content to file here
}
}
}
}