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

Send one message with two blind copies

See more Email Object Examples

Set NoBccHeader before adding blind-copy addresses. SendEmail then includes those recipients in the SMTP envelope and omits their addresses from the message headers sent to the relay. Replace the example account and addresses before running this SMTP submission.

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";
email.Body = "Registration is confirmed.";
//  Set this before AddBcc so the submitted MIME omits the Bcc header.
email.UncommonOptions = "NoBccHeader";
success = email.AddBcc("Archive","archive@example.com");
if (success !== true) {
    console.log(email.LastErrorText);
    return;
}

success = email.AddBcc("Event records","records@example.com");
if (success !== true) {
    console.log(email.LastErrorText);
    return;
}

var mail = new CkMailMan();
mail.SmtpHost = "smtp.example.com";
mail.SmtpPort = 465;
mail.SmtpSsl = true;
mail.RequireSslCertVerify = true;
mail.SmtpUsername = "SMTP_USERNAME";
mail.SmtpPassword = "SMTP_PASSWORD";
success = mail.SendEmail(email);
if (success !== true) {
    console.log(mail.LastErrorText);
    return;
}

console.log("SMTP relay accepted the submission.");
success = mail.CloseSmtpConnection();
if (success !== true) {
    console.log("The SMTP session did not close cleanly.");
}