Hi,
I am having trouble sending mail with PHP's mail() function when I try to use CC or BCC in the additional headers. Here is the code I have now:
<?php
$to = "example@example.com";
$body = "message body";
$subj = "Subject";
$headers = "";
/* additional headers */
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";
$headers .= "Cc: test@test.com\r\n";
$headers .= "Bcc: beta@beta.com\r\n";
$sent = mail($to, $subj, $body, $headers);
if (!$sent)
die("Error sending message");
else
print "Message sent successfully";
?>
When I use the additional fields besides FROM in the $headers variable in the mail() function, it takes a long time to send the message to the $to address and never sends the message to the CC or BCC addresses.
Any ideas what is causing this?
Rob