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.FileAttachment가 Microsoft.Graph.IMessageAttachmentsCollectionPage로 변환 할 수 없기 때문에 내가 올바르게 말한 것입니다. – twc