Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
How to set sensitivity header in eml file for Outlook?

I'm trying to write an email via a dynamically created eml file with JavaScript.

I've modified this code to my needs from another SO answer but I'm not sure why Sensitivity and Priority headers are not working when I open the file with Outlook. In Outlook I see differently named sensitivity levels compared to rfc2156 (company set or Outlook?): "public", "internal", "confidential", and "strictly confidential". Not sure if that's important.

I've tried all possible combinations, with or without double quotes, etc but so far nothing seems to set either headers. I can see them If I read the eml in text editor but when I open the file in Outlook I just see the default settings being applied.

I'm using Outlook version 2102.

const emailBody = "<html><body><b>hello</b> world</body></html>";

let emlHeader = "data:message/rfc822 eml;charset=utf-8,";
emlHeader += `From: guy1@mail.io\n`;
emlHeader += `Subject: Sensitive message\n`;
emlHeader += `To: guy2@mail.io\n`;
emlHeader += `Bcc: guy2@mail.io\n`;
emlHeader += `Date: Sun, 10 Jul 2022 03:54:14 +0000\n`;
emlHeader += "Priority: Urgent\n";
emlHeader += "Sensitivity: Private\n";
emlHeader += "X-Unsent: 1\n";

const emlString = `${emlHeader}\n\n${emailBody}`;

const emlContent = encodeURI(emlString); //encode spaces etc like an url
const a = document.createElement("a"); //make a link in document
a.href = emlContent;
a.id = "fileLink";
a.download = "filename.eml";
a.style = "display:none;"; // hidden link
document.body.appendChild(a);
document.getElementById("fileLink").click(); //click the link
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For PR_IMPORTANCE (possible values are IMPORTANCE_HIGH, IMPORTANCE_NORMAL, IMPORTANCE_LOW), you need X-Priority headers with values of 1, 2, and 3 correspondingly. You can also set X-MSMail-Priority header (Outlook specific) to High, Normal, Low.

For PR_SENSITIVITY (possible values in MAPI are SENSITIVITY_PERSONAL, SENSITIVITY_PRIVATE, SENSITIVITY_COMPANY_CONFIDENTIAL), you need to set Sensitivity header to Personal, Private, Company-Confidential correspondingly.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!