Setting Bcc: Recipients

Bcc: recipients receive a copy of the message without anybody else knowing it, and are set with the setBcc() or addBcc methods of the message.

To set Bcc: recipients, create the message object using either new Swift_Message( ... ) or Swift_Message::newInstance( ... ), then call the setBcc() method with a complete array of addresses, or use the addBcc() method to iteratively add recipients.

The setBcc() method accepts input in various formats as described in the chapter, Addresses in Swift Mailer. The addBcc() method takes either one or two parameters. The first being the email address and the second optional parameter being the name of the recipient.

Only the individual Bcc: recipient will see their address in the message headers. Other recipients (including other Bcc: recipients) will not see the address.

Note: You should not use Bcc: recipients as a mechanism for sending bulk email with undisclosed recipients. You should perform a batchSend() instead.
Note: Multiple calls to setBcc() will not add new recipients – each call overrides the previous calls. If you want to iteratively add Bcc: recipients, use the addBcc() method.
//Using setBcc() to set all recipients in one go
$message->setBcc(array(
  'person1@example.org',
  'person2@otherdomain.org' => 'Person 2 Name',
  'person3@example.org',
  'person4@example.org',
  'person5@example.org' => 'Person 5 Name'
));

//Using addBcc() to add recipients iteratively
$message->addBcc('person1@example.org');
$message->addBcc('person2@example.org', 'Person 2 Name');

NOTE: Documentation for version 3 is in the wiki.