using Microsoft.Graph
IMessageAttachmentsCollectionPage Message.Attachments
我似乎无法使用FileAttachment.ContentBytes中的任何"ContentBytes"。
我的示例来自Microsoft https://github.com/microsoftgraph/aspnet-snippets-sample。
// Create the message.
Message email = new Message
{
Body = new ItemBody
{
Content = Resource.Prop_Body + guid,
ContentType = BodyType.Text,
},
Subject = Resource.Prop_Subject + guid.Substring(0, 8),
ToRecipients = recipients,
HasAttachments = true,
Attachments = new[]
{
new FileAttachment
{
ODataType = "#microsoft.graph.fileAttachment",
ContentBytes = contentBytes,
ContentType = contentType,
ContentId = "testing",
Name = "tesing.png"
}
}
};