jakebur01 Posted October 10, 2007 Share Posted October 10, 2007 If I have say a thousand or so of my customers e-mails to send out, is their a way that I could set the execution time at the beginning of the script and loop through sending an e-mail to each individual one by one and pausing in between? Like, I know the browser might time out after 30 seconds if it does not receive any new data. Could I run a loop that would send a message to the browser every 10 seconds while running the sleep/mail loop. Ex. Loop to browser to keep it going - Send e-mail ---- sleep for a minute or so --- and send the next e-mail -- sleep -- and so on Thanks, Jake Link to comment https://forums.phpfreaks.com/topic/72557-solved-sending-a-lot-of-mail/ Share on other sites More sharing options...
KrisNz Posted October 10, 2007 Share Posted October 10, 2007 As a basic solution, try using the set_time_limit() and sleep() functions. Link to comment https://forums.phpfreaks.com/topic/72557-solved-sending-a-lot-of-mail/#findComment-365951 Share on other sites More sharing options...
prime Posted October 10, 2007 Share Posted October 10, 2007 I suppose if you have the emails in a database or a falt file you could do a foreach loop on each soemthing like while ($row = mysql_fetch_array($result)) { mail($name,$subject,$body) } I know thats simplistic but without knowing if you have a database or what variables they're stored in, but something like that should work Link to comment https://forums.phpfreaks.com/topic/72557-solved-sending-a-lot-of-mail/#findComment-365963 Share on other sites More sharing options...
jakebur01 Posted October 10, 2007 Author Share Posted October 10, 2007 thanks. Link to comment https://forums.phpfreaks.com/topic/72557-solved-sending-a-lot-of-mail/#findComment-365966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.