we are using c# to send outlook mail activity.
but we are getting one pop up please select level public or confidential every time.
I tried to add below code but still not working.
OutlookNM.MailItem oMsg = (OutlookNM.MailItem)oApp.CreateItem(OutlookNM.OlItemType.olMailItem)
oMsg.Sensitivity = OutlookNM.OlSensitivity.olNormal
after adding the above line still I am getting same level popup.

Jignesh KumarRank #91 · 22.9K reputationPosted Dec 5, 2022, 5:15 AM EST
Hi Raj,
just try to add this one in you mail sending event,
mail.Headers.Add("Sensitivity", "Company-Confidential");raj rajRank #5,629 · 292 reputationPosted Dec 5, 2022, 6:50 AM EST
this is console application how can we add header
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 5, 2022, 8:01 AM EST
Hello Raj,
Can you add sample code snippet for that ?
raj rajRank #5,629 · 292 reputationPosted Dec 5, 2022, 11:13 PM EST
using OutlookNM = Microsoft.Office.Interop.Outlook;
OutlookNM.Application oApp = new OutlookNM.Application();
if (!string.IsNullOrEmpty(outlookSendMailModel.OutlookProfileName))
{
OutlookNM.NameSpace ns;
ns = oApp.GetNamespace("MAPI");
ns.Logon(outlookSendMailModel.OutlookProfileName);
}
OutlookNM.MailItem oMsg = (OutlookNM.MailItem)oApp.CreateItem(OutlookNM.OlItemType.olMailItem);
oMsg.Subject = outlookSendMailModel.Subject;
oMsg.Sensitivity = OutlookNM.OlSensitivity.olConfidential;
oMsg.Send();
raj rajRank #5,629 · 292 reputationPosted Dec 6, 2022, 12:00 AM EST
Hi Jignesh,
I added code.