简体   繁体   中英

How to send digitally signed e-mail using with Microsoft Graph?

I can send e-mails using Microsoft Graph using the code below. However, I need to send digitally signed e-mails but do not know how?

    ClientSecretCredential credentials = new ClientSecretCredential(
                    "--TenantId--", 
                    "--ClientId--", 
                    "--Secret--", 
                    new TokenCredentialOptions { AuthorityHost = AzureAuthorityHosts.AzurePublicCloud });

            GraphServiceClient graphServiceClient = new GraphServiceClient(credentials);

            Message message = new Message
            {
                Subject = "Test",
                Body = new ItemBody
                {
                    ContentType = BodyType.Html,
                    Content = "Some text"
                },
                ToRecipients = new List<Recipient>()
                {
                    new Recipient { EmailAddress = new EmailAddress { Address = "somebody@somewhere.com" }}
                }
            };
 
            graphServiceClient
                .Users["--UserId--"]
                .SendMail(message, false)
                .Request()
                .PostAsync().Wait();

AFAIK there is no provision for sending the digitally signed email using the MS graph, but you can raise a Feature request for same.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM