Creating Mail Queues
View Single Post
11-16-2007, 01:59 AM
Join Date: Nov 2007
Firstly, I'd recommend PHP Mailer:
I've used that MIME Mail class, and I prefer PHPMailer over it, especially in reliance and speed. I've seen this mail class run on sites with hundreds of new sign ups a day, and never break under the load.
I'd also use the SMTP option with PHPMailer, as Apache + PHP wasn't really designed to send email, w/ the Mail function. Connecting directly the SMTP to send out email is much faster and takes a lot of the load off of PHP.
As far as the queue goes, you can do it several ways...
You could add it to a file, then a cron goes through and grabs like, the first 100 lines, sends out those emails every 5 mins or so.
Or, you can have it in a DB, and when you insert they sign up, insert them into your Database, then have the CRON run every like... 3 - 5 mins, or whatever delay you want, and it goes through the DB and finds all of the users that have signed up, but have yet to receive their E-mail.
The Following User Says Thank You to dschreck For This Useful Post:
View Public Profile
Send a private message to dschreck
Visit dschreck's homepage!
Find More Posts by dschreck