hello here is my php code for sending an email, when the mail is sent the address in the bcc section don't receive the email:
<?php
$to = "abc@abc.com";
$subject = 'Form Submited To ABC Website';
$headers = "From: online@abc.com
";
$headers .= "Bcc: info@abc.com
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=utf-8
";
?>
the mails are not the rals ones for confidential reasons
PHP mail() syntax is:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
Find bellow code for more understanding.
<?php
// multiple recipients
$to = 'aidan@example.com' . ', '; // note the comma, if you have multiple or else no comma.
$to .= 'wez@example.com';
// subject
$subject = 'Hello';
// message
$message = '<html><body><h2>Testing MSG</h2></body>';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
// Additional headers
$headers .= 'To: Jiten <Jiten@example.com>, Kelly <hi@example.com>' . "
";
$headers .= 'From: from_name <from_name@example.com>' . "
";
$headers .= 'Cc: cc_email@example.com' . "
";
$headers .= 'Bcc: bcc@example.com' . "
";
// Mail it
mail($to, $subject, $message, $headers);