fastsol Posted May 31, 2015 Share Posted May 31, 2015 I already have a method of sending hundreds of emails by creating a db que that a cron runs every so often. My question is, is there a better way or a way at all to run a php script just once and be able to send hundreds of emails? I run my site on a dedicated server, so I have complete control of it. I would imagine that php would timeout when trying to send that much info. I would be sending a mixture of some emails over smtp and some straight from my server depending on the domain the email is going to. Basically anything going to a microsoft address flows through a gmail smtp to ensure it delivers to an inbox and not a spambox, everything else goes out of my mail host on my server. I use phpmailer for all email sending. Since all these emails are being sent based on certain db conditions in table data, I am making a que table that a cron runs to gather the according IDs and saves those. Then another script/cron runs that actually sends the emails, which then marks the que table as sent as it goes for each ID. I do it this way cause the que table could possibly gather more IDs in a run than the sending script is set to actually send. So the sending cron runs X times more than the que cron. Now maybe trying to send more emails in a single shot is pointless when I have all this cron doing it for me anyway, but I an tired of making 2 separate scripts, crons and tables to achieve a single goal for each automatic email I want to send. Please don't suggest a email sending service as I have already looked at that option and at least as of today I have not found one that allows me to submit a chunk of data for them to send. All places I talked to make you have a customer list, blah blah blah. I only want to do this with my server, not a mail service. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/296566-how-to-send-hundreds-of-emails-at-a-time/ Share on other sites More sharing options...
jcbones Posted June 1, 2015 Share Posted June 1, 2015 You could write a bash script, and call it with cron. Quote Link to comment https://forums.phpfreaks.com/topic/296566-how-to-send-hundreds-of-emails-at-a-time/#findComment-1512949 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.