Re: Is a while loop the most efficient way to send out multiple emails?

From: Date: Tue, 30 Dec 2003 11:32:17 +0000
Subject: Re: Is a while loop the most efficient way to send out multiple emails?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173477@lists.php.net to get a copy of this message
Dave -- ..and then Dave G said... % % PHP Gurus, % I currently run a few newsletters that go out to small groups of % 50 to 100 people. I use a while loop to send out the emails. I chose a .. % about 50 people. I'm not sure exactly, but maybe ten seconds, possibly % as high as twenty. % Soon I will be creating a script to send out an email to 500 .. % So my question is, is there a way more efficient than while % loops to send out multiple emails with personalized information? Is it % the mail() command that takes time, or the mysql_fetch_array(), or both? % Any suggestions would be greatly appreciated. 0) That really should be $member['name'] and $member['email'] instead of bare indices, you know :-) 1) It's definitely the mail() command, and that's dependent on the underlying mail system. 2) Driving this from the browser is probably a bad way to go because you will always be fighting timeout issues *and* what about a broken connection not because of a timeout? 3) If you want full personalization, you're stuck with individual emails, but lots of mailing list software out there can handle VERPing and, say, footers and save you a whopping lot of work. 4) I did some work this summer on a mass mail script; with a little script tweaking and some (but not onerous) qmail tweaking, I got our times down to around 100ms per email. That puts us sending about 30k [personalized] emails per hour, which is an order of magnitude faster than the speed of the guys who lost the contract to us :-) It's discussed on the list a bit; check the archives. HTH & HAND & Happy Holidays :-D -- David T-G * There is too much animal courage in (play) davidtg@justpickone.org * society and not sufficient moral courage. (work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

« previous php.general (#173477) next »