Hey,
I have a small mailing list script. The following code is emant to send the email message to every member who has signed up to the mailing list (mailing_list set to 1 in database)
Currently there are 3 members subscribed to the mailing list, but only one member receives it, and firther more they receive the message twice
$sql = mysql_query("SELECT email FROM cms_users WHERE mailing_list='1'");
$participants = mysql_num_rows($sql);
$fetch = mysql_fetch_array($sql);
foreach($fetch as $to){
mail($to, "$subject", "$body", "FROM: webmaster <webmaster@hiphopreaction.com>");
}
/* END Send the email */
Suggestions and help more than appreciated.
Thanks