Setting Cc: Recipients

Cc: recipients are set with the setCc() or addCc() methods of the message.

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

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

Cc: recipients are visible in the message headers and will be seen by the other recipients.

Note: Multiple calls to setCc() will not add new recipients – each call overrides the previous calls. If you want to iteratively add Cc: recipients, use the addCc() method.
//Using setCc() to set all recipients in one go
$message->setCc(array(
  'person1@example.org',
  'person2@otherdomain.org' => 'Person 2 Name',
  'person3@example.org',
  'person4@example.org',
  'person5@example.org' => 'Person 5 Name'
));

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

NOTE: Documentation for version 3 is in the wiki.