QUICK help, loop - wait

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

QUICK help, loop - wait

Post 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 />";}
}
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

sleep(), or use Swiftmailers antiflood plugin
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

Heh.. Thanks. Didn't knew about this function before.
Post Reply