If your code uses wp_mail
function to send emails, then you can specify multiple recipients using an array or a comma-separated string.
So your $emailTo
will be..
$emailTo = array(
'[email protected]',
'[email protected]',
'[email protected]',
);
If your code does not use wp_mail
function then you can define multiple instance of PHP mail function.
To BCC and CC with wp_mail
, you must use the $headers
argument. If it’s not already defined in your wp_mail
then here is a simple example.
$headers[] = 'From: Me Myself <[email protected]>';
$headers[] = 'Cc: John Q Codex <[email protected]>';
$headers[] = 'Cc: [email protected]';
Although adding email addresses with array (first code) will work just fine, and unless you have a good reason to use BCC/CC headers, you should use it.