I want to send BCC email along with Recipient in Contact form. How I can include BCC in my code? I am not seeing error in below code but it won't send you email to BCC or Recipient. If I remove BCC, it will send you to Recipient.
$recipient = "xjkfak223@gmail.com";
// Set the email subject.
$subject = "New contact from $name";
// Build the email content.
$email_content = "Name: $name\n";
$email_content .= "Email: $email\n\n";
$email_content .= "Phone: $phone\n\n";
$email_content .= "Message: $message\n";
$email_content .= "$subscribe: Yes\n";
// Build the email headers.
$email_headers = "From: $name <$email>";
$email_headers = "BCC: xy123@gmail.com";
// Send the email.
if (mail($recipient, $subject, $email_content, $email_headers)) {
// Set a 200 (okay) response code.
http_response_code(200);
echo "Thank You for Contacting Us.";
}