RE: [PHP] File array mailing Loop problem. Help needed urgently

From: Date: Mon, 03 Mar 2003 03:23:13 +0000
Subject: RE: [PHP] File array mailing Loop problem. Help needed urgently
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137840@lists.php.net to get a copy of this message
[snip] > The script is working everything is send the way I wish, the only problem > is > that the 200 user would see all 199 useres email addresses before him .. > and so on each member Member 800 sees 799 emails in the email as well 799 > times the from address big problem. > > I want to send each email in single loop ? so that each client gets only > one email address to see and my whole doing is not a security risk [snip] > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: ".$myname." <".$myemail.">\r\n"; > $headers .= "To: ".$contactname." <".$contactemail.">\r\n"; > $headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n"; > $headers .= "X-Priority: 1\r\n"; > $headers .= "X-MSMail-Priority: High\r\n"; > $headers .= "X-Mailer: Server Text here"; > > mail($contactemail, $subject, $message, $headers); You're constantly building up $headers with each loop. You're first line should be $headers = "MIME-Version: 1.0\r\n"; so that it starts from an empty string and adds the rest. Or, clear $headers after you call mail(), so the next loop starts with an empty variable. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#137840) next »