mforan Posted January 14, 2008 Share Posted January 14, 2008 hi there, i run an online game. my problem is that i need to keep in contact with members that have once played the game before. so basically, i need to be emailing around abouts 8000 users. i understand il probably need to use an array to do this. the main problem i have is that, mailing 8000 people just isnt really gunna work. is there anyway that i can send the emails with some kind of delay, as to avoid emails not being sent etc? basically i just need a mass email solution that i can code myself to pull email addresses with the mysql database and then email them users. the basic idea is to mail people and tell them, to check out the game once again, like many sites do! any idea anyone, would be greatly appreciated! mike. Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/ Share on other sites More sharing options...
cooldude832 Posted January 14, 2008 Share Posted January 14, 2008 I built one of these in the past that does it via a cron job sending X emails every hour until it clears the list. Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-438503 Share on other sites More sharing options...
AndyB Posted January 14, 2008 Share Posted January 14, 2008 Send x emails, sleep() for a second - gives the mail server a rest - then repeat until done. http://ca.php.net/manual/en/function.sleep.php while (whatever it is) { // send an email $mails++; if ($mails==50) { $mails=0; sleep(1); } } // all done Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-438522 Share on other sites More sharing options...
cooldude832 Posted January 14, 2008 Share Posted January 14, 2008 only issue is that the realsitic sleep for mail server to "calm down" is 30 seconds you say 100 emails a batch across 8000 users your at a 40 minute script and most of the time your server administration won't let that happen. Cron makes a strong choice here, but more complex to set up. As you can cron say 500 an hour and spread it out more Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-438524 Share on other sites More sharing options...
mforan Posted January 15, 2008 Author Share Posted January 15, 2008 how would a cron do this then? im a bit of an ameutuer when it comes toi cron jobs lol. lets just say i want to grab all the "email" addresses from the table "free".... and send it how you said, like 500 an hour. how would be the best way to cron that ??? Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-440345 Share on other sites More sharing options...
cooldude832 Posted January 16, 2008 Share Posted January 16, 2008 the script I wrote was a tad bit complicated to just "explain" but basically it involved getting the list of users to send to putting those in a temporary table and then send them in order of the date they were put in this temp table. THe cron job runs every X hours/mins/days/weeks etc sending Y emails out from the top of the list. If the list is clear it doesn't send any more but it still runs (no big deal) Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-440537 Share on other sites More sharing options...
jamescarvin Posted January 16, 2008 Share Posted January 16, 2008 How do large companies that have literally millions of customers do it? Surely they don't have to wait days at a time, what's more they don't get filtered by ISPs as spam. What's the trick? Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-440909 Share on other sites More sharing options...
adam291086 Posted January 16, 2008 Share Posted January 16, 2008 @jamescarvin They will have there own email exchange setup to deal with this. Therefore they can deal with the high demand. I persume mforan is trying to do this through a remote host. Therefore he will have limited server capabilities. Whereas a large company will have a fleet of servers to send emails Quote Link to comment https://forums.phpfreaks.com/topic/85888-mass-e-mail-problem/#findComment-440916 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.