using Microsoft.Graph
IMessageAttachmentsCollectionPage Message.Attachments
FileAttachment.ContentBytesにある「ContentBytes」を取得することはできません。Microsoft.Graph添付ファイル付きメールを送信
サンプルは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"
}
}
};
議会Microsoft.Graph、バージョン= 1.2.0.0は、添付ファイルのJSONプロパティを設定することを私には明確か明確にしたいです。したがって、あなたがそれを使用する場合、それを使用して添付ファイルを送信することはできません。私が正しく言うなら、Microsoft.graph.FileAttachmentはMicrosoft.Graph.IMessageAttachmentsCollectionPageに変換できないからです。 – twc