Android™
Android™
Clear the Bcc Recipients of an Email
See more Email Object Examples
Demonstrates the Chilkat Email.ClearBcc method, which clears the list of blind carbon-copy (Bcc) recipients. It changes only the current in-memory email object and does not affect messages already sent. This example adds two Bcc recipients, clears them, and prints the count before and after.
Background: Reusing one
Email object as a template for several messages is common — you set the subject and body once and vary the recipients. Clearing methods like ClearBcc, ClearCC, and ClearTo let you reset one recipient list between sends without rebuilding the whole message, so a stray Bcc from a previous send does not leak into the next.Chilkat Android™ Downloads
// 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 ClearBcc method, which clears the list of blind carbon-copy (Bcc)
// recipients. This changes only the current email object.
CkEmail email = new CkEmail();
email.AddBcc("Joe","joe@example.com");
email.AddBcc("Jane","jane@example.com");
Log.i(TAG, "NumBcc before clear = " + String.valueOf(email.get_NumBcc()));
// Remove all Bcc recipients.
email.ClearBcc();
Log.i(TAG, "NumBcc after clear = " + 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."
}
}