相关疑难解决方法(0)

Microsoft.Graph 发送带附件的邮件

using Microsoft.Graph
IMessageAttachmentsCollectionPage Message.Attachments
Run Code Online (Sandbox Code Playgroud)

我似乎无法得到它来获取 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"
            }
        }
};
Run Code Online (Sandbox Code Playgroud)

c# microsoft-graph-api

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

microsoft-graph-api ×1