note 24464 added to ref.mail

From: Date: Fri, 16 Aug 2002 20:46:21 +0000
Subject: note 24464 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-35155@lists.php.net to get a copy of this message
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> -- http://www.php.net/manual/en/ref.mail.php http://master.php.net/manage/user-notes.php?action=edit+24464 http://master.php.net/manage/user-notes.php?action=delete+24464 http://master.php.net/manage/user-notes.php?action=reject+24464

« previous php.notes (#35155) next »