Hi,
To send an email to recipients in copy and to recipients in hidden copy, you can use the solution below. The main recipient has to be added directly to PHP mail() function. Copy recipients or Hidden copy recipients have to be included in additional headers.
$sender = "sender@example.com";
$sendername = "Name Surname";
$recipient = "main.recipient@example.com";
$copyrecipient = "copy.recipient@example.com";
$hiddencopyrecipient = "hiddencopy.recipient@example.com";
$subject = "Email subject";
$content = "Text or HTML content";
$headers = "From: " . $sendername . " <" . $sender . ">\n" ;
$headers .= "Cc: " . $copyrecipient . "\nBcc: " . $hiddencopyrecipient . "\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=utf-8\n";
$headers .= "Return-Path: " . $sender . "\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$send = mail($recipient, $subject, $content, $headers);
if ($send) { echo "Email sent"; } else { echo "Email not sent"; }