Page 1 of 1

sending 5000 mass email with php

Posted: Sun Apr 10, 2005 8:25 am
by genux33
hi ,
what is the reasonable way to send mass email using php. i saw thread mentioning that the mail() function in PHP for anything over 100 mails, not even using it by breaking out your recipients in batches of 25, 50, 100 etc. and looping with the function?
any advise?

Posted: Sun Apr 10, 2005 8:34 am
by Chris Corbyn
The mail function could handle it if you set the time limit to zero and providing your ISP permits it....

BUT why so many?

Posted: Sun Apr 10, 2005 8:39 am
by genux33
d11wtq wrote:The mail function could handle it if you set the time limit to zero and providing your ISP permits it....

BUT why so many?
where did u set time limit to zero??? currently my company hosting the server.

Posted: Sun Apr 10, 2005 8:44 am
by Chris Corbyn
set_time_limit()
mail()
foreach() loops

All the help you need is on http://www.php.net/

Still not sure why you need to send so many?

Posted: Sun Apr 10, 2005 1:20 pm
by Sphen001
If you need to send so many emails, the best way would be to break it up into sections. It might be useful to write a few functions to handle this for you.

Sphen001

Posted: Sun Apr 10, 2005 3:07 pm
by John Cartwright
The recommended way is to have all the emails needing to be emailed set in a database (proving you have a unique id column, and a flag column to differenciate sent emails and pending emails).

You can then use a cron job if your on linux systems, or task manager on windows.
Have it set to run your email file every 5-10 mins or so, the longer you wait the better.
So now as you loop through lets say 50 emails, set their flag to sent and then in the next 5-10 min it will loop through again, and again, until no more emails are pending.