I'm trying to send an e-mail using the PHP mail() function and it is not working when I use the Cc header field. Here is my code:
$headers = "From: ". $_POST['name'] ." <". $_POST['email'] .">\r\n";
$headers .= "Cc: ". $_POST['cc'] ."\r\n";
// Send E-mail
mail ( $to, $_POST['subject'], $_POST['comments'], $headers);
With the above code, it eventually does send to the $to address, but it can take a while. It never sends to the Cc address. If I replace the mail() line with the following, it sends to the $to address right away:
mail ( $to, $_POST['subject'], $_POST['comments'], "From: ". $_POST['name'] ." <". $_POST['email'] .">\r\n");
Any ideas what I'm doing wrong?