0

I use System.Net.Mail in a program I wrote to send emails to multiple addresses. Some of them using HCL Note and they cannot open the emails that have been send via my tool. Meanwhile I found out that the emails are sent with Sensitivity "Private" (like in outlook: https://support.content.office.net/en-us/media/e4eef27b-95d6-4c7e-a449-c47e6454750d.png).

My questions is whether or not there is possibility to set the mails with Sensitivity "Normal"?

I use the following code (abstract):

    var message = new MailMessage();
    message.To.Add(TOadressee.ToString());
    message.CC.Add(CCadressee.ToString());
    message.From = new MailAddress("claims@l-und-b.de", String.Empty, System.Text.Encoding.UTF8);
    message.Subject = "Subject line";
    message.BodyEncoding = System.Text.Encoding.UTF8;
    message.Body = "messagetext";
    message.IsBodyHtml = true;

    var client = new SmtpClient("smtp.office365.com", 587);
    client.EnableSsl = true;
    client.Credentials = new                    

    System.Net.NetworkCredential(senderaddress, password);
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    client.Send(message);

I have no idea where else to look. Hope some of you guys can give me some input.

Or is there another free mail package available that supports smtp and that sensitivity thing?

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • Hello. I found this. Can it work for you? https://stackoverflow.com/questions/32488438/how-do-i-set-the-sensitivity-on-an-email-in-c – Radu Caprescu Nov 11 '21 at 13:02

1 Answers1

0

So, sensitivity is a header attribute for the mail item. Email clients carry some standards of there own, that doesn't necessarily trasmit to a property in the .Net mail item.

However, the MailMessage class will allow you to access the header and add anything there (kind like on a htpp request/response header - as a collection of key/value pairs).

You must match those with aggreed standards, usually documented on a RFCXXX (that's the case with this one, for RFC1327, that sets a header for the "Sensitivity" clause, as a RFC822 model.

So you can use like: message.Headers.Add("Sensitivity", "Company-Confidential")

SammuelMiranda
  • 420
  • 4
  • 29