How to send an encrypted/targeted users email with custom sensitivity label?

95 Views Asked by At

My company uses M365 with custom sensitivity labels in MIP. Some of this custom labels are configured to encrypt email and to target some specific users, inside or outside our organisation.

Using Outlook, when writing the email, we choose the labels and everything works fine.

I need to do the same in a C# program running on a on premise server (without Office installed) but I'm blocked on the encryption part.

Thanks to the tutorial of the MIP SDK, I'm able to get the custom sensitivity labels.

As my server doesn't have Outlook, I can't use the Outlook objects so I'm using Mimekit/MailKit nuget package. I'm then able to send an email with a "simple" label who does not encrypt (I found how to add the msip_labels specific header with what looks like the right values).

Now, I don't understand how the email is encrypt and the target users are written. I didn't really found any documentation on this particular part. I tried to send the email with the label, the label is shown in outlook but the message is not encrypted (no lock).

There is in the MIP SDK tutorial a part where you can encrypt a text. I tried to encrypt the body of my mail but it's not that.

Has anyone managed to do this ? Or at least, can someone explain the mechanism of the MIP encryption/target user selection in an email ?

0

There are 0 best solutions below