JavaScript Requires Chilkat v11.0.0+
JavaScript
Set the display priority of a message
See more Email Object Examples
Set X-Priority to 1 (high), 3 (normal), or 5 (low). A mail reader can use it as a display hint. SMTP delivery order is controlled by the mail system.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat
v11.4.0 or greater.
var success = false;
// Assumes Chilkat is unlocked. See Global Unlock Sample.
var email = new CkEmail();
email.From = "Workshop team <events@example.com>";
success = email.AddTo("Alex Rivera","alex@example.net");
if (success !== true) {
console.log(email.LastErrorText);
return;
}
email.Subject = "Workshop venue change";
email.Body = "Please use the north entrance.";
email.AddHeaderField("X-Priority","1 (High)");
console.log("Priority: " + email.GetHeaderField("X-Priority"));
success = email.SaveEml("venue-change.eml");
if (success !== true) {
console.log(email.LastErrorText);
return;
}
console.log("Saved venue-change.eml.");