Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Node.js Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Node.js) Email BCC Recipients

See more Email Object Examples

Explains the meaning of BCC recipients, how it is different than CC recipients, and how Chilkat handles BCC.

Install Chilkat for Node.js and Electron using npm at

Chilkat npm packages for Node.js

Chilkat npm packages for Electron

on Windows, Linux, MacOSX, and ARM

var os = require('os');
if (os.platform() == 'win32') {  
    if (os.arch() == 'ia32') {
        var chilkat = require('@chilkat/ck-node21-win-ia32');
    } else {
        var chilkat = require('@chilkat/ck-node21-win64'); 
    }
} else if (os.platform() == 'linux') {
    if (os.arch() == 'arm') {
        var chilkat = require('@chilkat/ck-node21-arm');
    } else if (os.arch() == 'x86') {
        var chilkat = require('@chilkat/ck-node21-linux32');
    } else {
        var chilkat = require('@chilkat/ck-node21-linux64');
    }
} else if (os.platform() == 'darwin') {
    if (os.arch() == 'arm64') {
        var chilkat = require('@chilkat/ck-node21-mac-m1');
    } else {
        var chilkat = require('@chilkat/ck-node21-macosx');
    }
}

function chilkatExample() {

    // In the context of email communication, the BCC (Blind Carbon Copy) field is used to send a copy of an email
    // to recipients without revealing their addresses to other recipients. When it comes to the MIME
    // header of an email, the BCC email addresses should not be included.
    // 
    // The MIME header is a part of an email message that contains metadata and other information about the email,
    // such as the sender, recipient(s), subject, and other details. However, the BCC field is meant to be a confidential field,
    // and its purpose is to hide the recipients email addresses from each other.
    // 
    // Including BCC email addresses in the MIME header would defeat the purpose of using BCC since it would expose
    // the hidden recipients addresses to the other recipients. This violates the intended privacy and confidentiality of the BCC feature.
    // 
    // To maintain the confidentiality of BCC recipients, the BCC field should only be used in the envelope of
    // the email during the SMTP (Simple Mail Transfer Protocol) transaction. The SMTP server handles the actual
    // delivery of the email to the respective recipients while keeping the BCC information hidden from other recipients.
    // 
    // It is important to ensure that BCC email addresses are not included in the MIME header of an email to
    // preserve the privacy and confidentiality of the recipients.

    // -----------------------------------------------------------------------------------------
    // To discuss how Chilkat handles BCC, let's first create an email with some BCC recipients.
    var email = new chilkat.Email();

    email.AddTo("Joe","joe@example.com");
    email.AddTo("Mary","mary@example.com");
    email.AddCC("Steve","steve@example.com");
    email.AddBcc("Jerry","jerry@example.com");
    email.AddBcc("Tom","tom@example.com");

    email.Subject = "test";
    email.Body = "test";

    // Let's examine the MIME
    console.log(email.GetMime());
    console.log("----------------");

    // We have the following.
    // Notice the BCC addresses are not present.  They are not included in the MIME header.

    // MIME-Version: 1.0
    // Date: Mon, 10 Jul 2023 13:57:22 -0500
    // Message-ID: <34606FFCB4A440B20E549A223F2F7BF0EB10EE2C@SLICE>
    // Content-Type: text/plain; charset=us-ascii; format=flowed
    // Content-Transfer-Encoding: 7bit
    // X-Priority: 3 (Normal)
    // To: Joe <joe@example.com>, Mary <mary@example.com>
    // Cc: Steve <steve@example.com>
    // Subject: test
    // 
    // test

    // However the BCC address are still stored in the Chilkat email object.
    // For example, you can examine the BCC recipients in the email object like this:
    var numBcc = email.NumBcc;
    console.log("Num BCC recipients = " + numBcc);

    var i = 0;
    while (i < numBcc) {
        console.log(i);
        console.log(email.GetBcc(i));
        console.log(email.GetBccName(i));
        console.log(email.GetBccAddr(i));
        console.log("-----");
        i = i+1;
    }

    // Output:

    // Num BCC recipients = 2
    // 0
    // Jerry <jerry@example.com>
    // Jerry
    // jerry@example.com
    // -----
    // 1
    // Tom <tom@example.com>
    // Tom
    // tom@example.com
    // -----

    // Thus, when the email is sent, it will also be sent to the BCC recipients,
    // but the email received by each of the recipients (i.e. the raw MIME of the email) 
    // should not and will not include the BCC email addresses.  There should be no way
    // for the recipients to know that the email was sent to the BCC addresses -- because if 
    // there is a way to know, then it is not truly BCC.

}

chilkatExample();

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.