email - php mail() not sending Cc and Bcc


I have a php file which sends an email after a contact form has been submitted.

The email delivers correctly to the recipient, but it does never deliver to the Cc and Bcc. In the received email, anyways, the Cc is there(of course Bcc doesnt show up but if Cc is there Bcc should be too), but it just does not deliver to them.

Here is the code

$from = '[email protected]';
$to = $_POST['mail'];
$name = $_POST['nombre'];
$lastname = $_POST['apellido'];
$msg = "this is the content of the mail";
$subject = 'this is the subj';
$headers = "From:".$from."\r\n";
$headers .= "Cc:".$from.", [email protected],[email protected]\r\n";
$headers .= "BCC:[email protected]\r\n";
if ($name=="" || $lastname=="" || $_POST['mensaje']=="" || $to==""){
    echo '0';
    if(mail($to, $subject, $msg, $headers)){
      echo '1';
      echo '-1';


People are also looking for solutions to the problem: php - How to change a Symfony parameter


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.