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?
sending 5000 mass email with php
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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?
mail()
foreach() loops
All the help you need is on http://www.php.net/
Still not sure why you need to send so many?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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.
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.