Forum Moderators: mack
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: sample.domainname.com\r\n";
$headers .= "CC: sample2.domainname.com\r\n";
$headers .= "BCC: sample3.domainname.com\r\n";
$mail_body = "Sample MEssage";
$Subject = "Sample Subject";
mail($email_to, $Subject, $mail_body, $headers);
Please help!
Many Thanks!
mailto:username@mydomain.com?cc=someone@somewhereelse.com
so just add "?cc=address" and / or "?bcc=address" and / or "?subject=subjectline" and / or "?body=bodyofemail"
Please note that anyone will be able to spot the CC or BCC from the code. and spiders can still steal them.
Might want to look at javascript to replace the mailto links.
sometimes the order can make all the difference, I personally would set yours like so
$headers = "From: sample.domainname.com\r\n";
$headers .= "CC: sample2.domainname.com\r\n";
$headers .= "BCC: sample3.domainname.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
I have spent tons of time with mail headers, sometimes you may need to swap the last 2 as well.
How can I send a message with BCC and CC? I tried the codes below but it doesn't work although it register in the header information but it did NOT send the message in the address I have put in the CC and BCC.
----------------------------------------------
<?php
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: sample.domainname.com\r\n";
$headers .= "CC: sample2.domainname.com\r\n";
$headers .= "BCC: sample3.domainname.com\r\n";
$mail_body = "Sample MEssage";
$Subject = "Sample Subject";
mail($email_to, $Subject, $mail_body, $headers);
?>
-------------------------------------------------
Please help!
Many Thanks!
I meant to make the corrections that JKMitchell mentioned, sorry, your capitalization may be an issue as well
$headers = "From: sample@domainname.com\r\n";
$headers .= "Cc: sample2@domainname.com\r\n";
$headers .= "Bcc: sample3@domainname.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";