Sample code for 30+ languages & platforms
JavaScript Requires Chilkat v11.0.0+

Request quoted-printable for text alternatives

See more Email Object Examples

Use this when a receiving system requires quoted-printable. The MIME charset describes the text encoding. Content-Transfer-Encoding describes how those bytes travel in a message. Inspect the rendered text parts for the encoding and the escaped equals sign.

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.
JavaScript
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 registration";
success = email.AddPlainTextAlternativeBody("Workshop code = A42");
if (success !== true) {
    console.log(email.LastErrorText);
    return;
}

success = email.AddHtmlAlternativeBody("<p>Workshop code = A42</p>");
if (success !== true) {
    console.log(email.LastErrorText);
    return;
}

email.AddHeaderField("Content-Transfer-Encoding","quoted-printable");
var mail = new CkMailMan();
var text = new CkStringBuilder();
success = mail.RenderToMimeSb(email,text);
if (success !== true) {
    console.log(mail.LastErrorText);
    return;
}

console.log(text.GetAsString());