the other day i got an order from a customer and he asked me to write a script that can email website articles when he submits them
fist thing he asked was sending emails to all users in a way that doesnt make any problem for his server cause he has lots of users
ok now for making this script i should plan for writing an email script that can send article to all users after submiting a news by the author.
-
this script should quee emails not to make the server down
-
and it should works on background and autumatically
nice example of this script can be phpbb3 group mail section
i googled to find something usefull for this script , any php class that can help
what’s your suggestion and how would you write if this order came to you ?
Use cron.
You can have a cron job run every 5 or 10 minutes that will send only a small percentage of emails at a time. That way it runs in the background and won’t slam the SMTP server.
The cron script should use a well-tested class such as PHP Mailer or SwiftMailer. Create a cross-reference table that keeps track of which addresses have been emailed which articles.