$headers can be a string or an array, but it may be easiest to use in
the array form. To use it, push a string onto the array, starting with
“From:”, “Bcc:” or “Cc:” (note the use of the “:”), followed by a
valid email address.
In other words:
$headers = array(
'From: [email protected]',
'CC: [email protected]',
'CC: [email protected]',
'BCC: [email protected]',
'BCC: [email protected]'
);
You can see where the Core parses the string by splitting it on that “:”:
296 list( $name, $content ) = explode( ':', trim( $header ), 2 );
297
298 // Cleanup crew
299 $name = trim( $name );
300 $content = trim( $content );
301
302 switch ( strtolower( $name ) ) {
303 // Mainly for legacy -- process a From: header if it's there
304 case 'from':
Note: This is untested but I am fairly confident. I did not want to start sending email to addresses without warning (if those are even active addresses).