Nolongerused3921 Posted January 10, 2007 Share Posted January 10, 2007 I'm getting to the newsletter part of my site, and right now I have it setup to go through every 12 hours, go through and check which user wanted the daily/twice a day/weekly/etc. newsletter, and if the time has been met - add them to the mail queue table... This is all using my task manager*, and I would like to send out the mail using it as well, but I'm not sure what would be the best way.I've been debating sending out 100 emails every 5 minutes, but I'm not sure if this is too much too soon, or if I can handle a few more. I'm also unsure of the best way to actually send these out, I can't decide if I want to use mail() or attempt to use SMTP... Which would be the best way, a way where it actually adds it to a queue rather then attempting to send them all at once, since this will be handled by my task manager.*My task manager is pretty simple, and is loaded every time a user opens a page. It checks a database with a list of tasks, how often that task is supposed to run, as well as the last run time - and if it has been long enough, it opens the correct file and runs that task. So whatever method I chose, the user can't be stuck with 1.0+ second long script run time.I also don't have to have access to server cronjobs to create a relatively on-time task. Link to comment https://forums.phpfreaks.com/topic/33540-sending-out-emails-in-php-best-method-and-how-often/ Share on other sites More sharing options...
magic2goodil Posted January 10, 2007 Share Posted January 10, 2007 Perhaps set it up to draw out the email addresses from your database into an array with mysql_query() right, then create a while loop to loop through the array 100 times or so and then sleep($x) x= amoutn of seconds to sleep for..then you will increment to the next, aka 101 and start again, sleeping at every multiple of 100 to allow your server to refresh itself... Link to comment https://forums.phpfreaks.com/topic/33540-sending-out-emails-in-php-best-method-and-how-often/#findComment-157087 Share on other sites More sharing options...
ali_kiyani Posted January 10, 2007 Share Posted January 10, 2007 I am also discussing this thing in another thread so if anybody can help me out I will be grateful.http://www.phpfreaks.com/forums/index.php/topic,119709.msg500615.html#msg500615 Link to comment https://forums.phpfreaks.com/topic/33540-sending-out-emails-in-php-best-method-and-how-often/#findComment-157122 Share on other sites More sharing options...
Nolongerused3921 Posted January 11, 2007 Author Share Posted January 11, 2007 Anyone? Link to comment https://forums.phpfreaks.com/topic/33540-sending-out-emails-in-php-best-method-and-how-often/#findComment-157973 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.