Re: weird mail function problem

From: Date: Mon, 21 Feb 2005 19:48:04 +0000
Subject: Re: weird mail function problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-209144@lists.php.net to get a copy of this message
You should have this at the top of your for loop $body=""; Ahmed Abdel-Aliem wrote:
hi i use this code to send email from mysite but when it sends to some accounts it repeats the body part twice in the same email while to other accounts it sends the body one time only can anyone help in that plz ? if ($email_to != "") { $to = array(); $to = explode (",", $email_to); $to_mum = count($email_to); for ($i=0; $i<$to_mum ; $i++){ $to_email = $to[$i]; $subject = $email_subject; $body .= $HTTP_POST_VARS['message']; $body .= "\n---------------------------\n"; $body .= "Article Name :"; $body .= "\n---------------------------\n"; $body .= $Article_Name; $body .= "\n---------------------------\n\n"; $body .= "\nStory :\n\n"; $body .= $TheStory; $body .= "\n\n\n---------------------------\n"; $body .= "Sent By: " . $HTTP_POST_VARS['email_address'] . "\n"; $header = "From: " . $HTTP_POST_VARS['email_address'] . " <" . $HTTP_POST_VARS['email_address'] . ">\n"; $header .= "Reply-To: " . $HTTP_POST_VARS['email_address'] . " <" . $HTTP_POST_VARS['email_address'] . ">\n"; $header .= "X-Mailer: PHP/" . phpversion() . "\n"; $header .= "X-Priority: 1"; mail($to_email, $subject, $body, $header);


« previous php.general (#209144) next »