I'm trying to CC an email via my php age, but no matter how I try to do it, a second copy is never sent. Here's what I've tried so far...

function mail_receipt($mail_to) {
$toaddress = $mail_to;
$fromaddress = "MIME-Version: 1.0\r\n";
$fromaddress .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$fromaddress .= "From: My Name <my@email.com>\r\n";
$fromaddress .= "Cc: my@email.com\r\n";
$subject = "Confirmation Email";
$mailcontent = "blah,blah,blah";
mail($toaddress,$subject,$mailcontent,$fromaddress);
}

The email sends fine to the $mail_to recipient and my email address shows up fine as the from address. However, it never sends off to the CC address. It shows up in the email as being CCed to that address, but no mail is ever received. Any ideas? I'm using PHP version 4.2.2

I also tried adding the email to the $toaddress and separating the two with a comma, but that didn't work either.

Thanks!
Wil

    Have you tried to read the mail users email? If it bounced it probably went to someone like webmaster@yoursite.com or something similar. Are you 100% positive you don't have any spelling mistakes in either address? Have you tried to switch them around (TO becomes CC and CC becomes TO)... try those.

      yo, you might want to check the mail() function docs, cuz like why are you specifying all those headers in the $fromaddress field? you can add headers on with some additional params to mail(), like at the end of the args. I forget. go look: http://www.php.net/function.mail ... erm yes.

      -fish

        Write a Reply...