SMTP mail with encrypt permission Outlook
Asked Answered
R

1

6

When I send a mail with the option "Encrypt only" in Outlook enter image description here

I receive a mail like this :

enter image description here

Currently, I use SMTPClient with MailMessage to send mail :

MailMessage message = new MailMessage();
message.From = from;
MailAddress to = new MailAddress(destString);
message.To.Add(to);
message.Subject = subject;
smtpClient.Send(message);

How can I modify my code to send a mail and receive it as the mail above ?

After some researching, I found a solution by using Interop but I can't use it in my project.

var app = new Microsoft.Office.Interop.Outlook.Application();
var item = (Microsoft.Office.Interop.Outlook.MailItem)app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
item.To = [email protected];
item.Subject = "test";
item.Permission = Microsoft.Office.Interop.Outlook.OlPermission.olDoNotForward;
item.PermissionService = Microsoft.Office.Interop.Outlook.OlPermissionService.olWindows;
item.Send();
Rhoda answered 6/9, 2022 at 7:34 Comment(0)
W
1

As far as I understand Outlook puts the message in a secure server (Office 365 in my case) and sends the recipient a link to open that message.

It is stated in this url, this feature is only for some licenses.

Microsoft 365 Message Encryption is part of the Office 365 Enterprise E3 license. Additionally, the Encrypt-Only feature (the option under the Encrypt button) is only enabled for subscribers (Microsoft 365 Apps for enterprise users) that also use Exchange Online.

I cannot find an API or library documentation, but you should try to communicate with your MS representative about this, so they can provide more information.

Watanabe answered 22/9, 2022 at 17:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.