Forum Moderators: coopster
While ($row = mysql_fetch_array($result)) {
$email = $row["email"];
mail($email, $sbj, $msg, $headers);
sleep(10);
}
this should halt the loop for 10 seconds after every email is sent.
Do you mean that none of the emails go out or do you get errors? You can test the return from the mail function. It returns true or false depending on the success.
[edited by: jatar_k at 2:14 am (utc) on Dec. 13, 2003]
Sleep every 200 emails or so instead. It would also be a good idea to do a header refresh at each sleep to stop the script from timing out.
This is assuming, of course, that you don't feel up to writing the script to mail in the background like all self respecting mailer scripts ;-)