Hi I recently created a very simple mailing list script that just uses a while loop to send a certain E-mail to all my site's members, the first few days it was working fine, until it hit 49 members, ever since then, it just mails the first 49 (ex. "Message was sent to 49 of 611 members") here's what i have:
......
$x = 0
while($i >= 0) { // ex. $i = 611
// gets variables from current row ($i) in DB
$name = mysql_result($result, $i, "first");
$email = mysql_result($result, $i, "email");
$id = mysql_result($result, $i, "id");
// set variables to mail
$subject = $title;
$body = "<html><head></head><body>" . $greeting . " " . $name . ",<br><br>" . $message . "</body></html>";
$headers = "From: webmaster@awesomeaims.com\r\n";
$headers .= "Content-Type: text/html; charset=ISO_8859-1\r\n
Content-Transfer_Encoding: 7bit\r\n";
// sends the email
if(mail($email, $subject, $body, $headers))
$x++;
else
$x = $x;
$i--;
}
$display = "The message was sent to " . $x . " out of " . $rows . " users.";
is there some kind of limit on how many times it can loop, or is it just getting ahead of itself with all the mailing
one last thing, about 75% of the time the mail goes to the user's bulk, or spam folder, how can I aviod that?