mail loop help!
Posted: Wed Sep 08, 2004 1:55 pm
hello everybody....
i am really close to what i want here, but can't get this script to output progress along the way.....it either times out or gives the results all at once (when it's done).....i want it to print line by line the output along the way so i can resend if it times out.
i have about 2000 entries in my db that i need to email blast....am i way off base in the way i'm doing this?
Thanks!
-Michael
i am really close to what i want here, but can't get this script to output progress along the way.....it either times out or gives the results all at once (when it's done).....i want it to print line by line the output along the way so i can resend if it times out.
Code: Select all
while ($row = mysql_fetch_array($query))
{
$email = $row['email'];
$fname = $row['fname'];
$lname = $row['lname'];
$bib = $row['bib'];
$body = "$fname $lname,\n
Your bib number is $bib\n";
stripslashes($body);
strip_tags($body);
stripslashes($subject);
strip_tags($subject);
mail($email, $subject, $body, $mailheaders);
echo "sending to ".$email."<Br>";
flush();
sleep(3);
}Thanks!
-Michael