note 24464 deleted from ref.mail by didou

From: Date: Sun, 07 Dec 2003 02:26:47 +0000
Subject: note 24464 deleted from ref.mail by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-61518@lists.php.net to get a copy of this message
Note Submitter: redy.r@NOSPAMmadagascan.com ---- If you need to send an e-mail with an html content and the same e-mail have Bcc headers. Place the Bcc (and why not also Cc) at the end of your additional headers. Otherwise, people receiving the email in copy may have the html code in their screen. The one who are designed as main recipient will not have this problem. Explanation : ========= The e-mail headers are broken when the PHP parser delete the Bcc line (Removed cause hidden, obvious !). Example : ======= This is bad $header = "From: \"".addslashes($sender_name)."\" <".$sender_email.">\r\n"; $header .= "Reply-To: ".$sender_email."\r\n"; $header .= "Cc: ".$other_email."\r\n"; $header .= "Bcc: ".$another_email."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $header .= "X-Priority: 1\r\n"; $header .= "X-Mailer: PHP / ".phpversion()."\r\n"; The following is good $header = "From: \"".addslashes($sender_name)."\" <".$sender_email.">\r\n"; $header .= "Reply-To: ".$sender_email."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $header .= "X-Priority: 1\r\n"; $header .= "X-Mailer: PHP / ".phpversion()."\r\n"; $header .= "Cc: ".$other_email."\r\n"; $header .= "Bcc: ".$another_email."\r\n"; Sorry for my bad english. :-) Redy Ramamonjisoa <redy.r@NOSPAMmadagascan.com>

« previous php.notes (#61518) next »