Page 1 of 1

QUICK help, loop - wait

Posted: Fri Apr 20, 2007 4:40 pm
by spamyboy
I have loop, to send mass mails to my users, but I can't find out way to make it wait ~2 sec. before doing another loop.

Code: Select all

while($row = mysql_fetch_array($result)){
if(mail($row['email'], $subject, $message, null, $sender))
{echo "mail sent";echo "<br />";}else{echo $row['email']." mail not sent";echo "<br />";}
}

Posted: Fri Apr 20, 2007 6:04 pm
by John Cartwright
sleep(), or use Swiftmailers antiflood plugin

Posted: Sat Apr 21, 2007 2:28 am
by spamyboy
Heh.. Thanks. Didn't knew about this function before.