Sample code for 30+ languages & platforms
Android™

Add a Bcc Recipient to an Email

See more Email Object Examples

Demonstrates the Chilkat Email.AddBcc method, which adds a single blind carbon-copy (Bcc) recipient. The first argument is the friendly display name and the second is the email address. This example adds one Bcc recipient and prints the resulting count.

Background: A Bcc ("blind carbon copy") recipient receives the message, but their address is hidden from everyone else — the mail server delivers the copy and then removes the Bcc header so no recipient can see who else was blind-copied. This makes Bcc the right choice for privacy (mailing a group without exposing addresses) and for silently keeping a copy in an archive or on a second address.

Chilkat Android™ Downloads

Android™
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //  Demonstrates the AddBcc method, which adds a single blind carbon-copy (Bcc) recipient.
    //  The 1st argument is the friendly (display) name, and the 2nd is the email address.

    CkEmail email = new CkEmail();
    email.put_Subject("Bcc example");
    email.put_From("alice@example.com");

    email.AddBcc("Joe","joe@example.com");

    Log.i(TAG, "NumBcc = " + String.valueOf(email.get_NumBcc()));

  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}