I’m trying to use BCC fields in some PHP email. My code is as below:
$to = "myemail@email.com";
$subject = 'Subject here';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "From: <myemail@email.com>\r\n";
$headers .= "Bcc: <myemail@email.com>\r\n";
//send the email
if (!mail($to, $subject, 'body', $headers)){
echo "Error";
}
What I’ve discovered is that if I include the bcc field in my headers the script just errors and the email is not sent. I’ve looked everywhere for the syntax and my understanding is that what I have is correct, but clearly something is wrong! Thanks
CC and BCC headers when using php’s mail() function are blocked by the suhosin security module.
I found this in: http://forums.asmallorange.com/topic/11501-php-mail-cc-bcc-headers/