Sondra Russell wrote:
> Yes, I saw the discussion a few days earlier on this topic, but I'm
But did you check the archives for the same discussion last month, the
month before, the month before that, ... :-)
> wondering if there is still some unmined wisdom out there about
> building a script that sends a newsletter out to 25,000+ people
> The very impressive class I found (phpmailer-1.41) looked great, but
> it didn't *directly* address the high-volume issue in the readme so
> I'm still a little nervous.
The internal http://php.net/mail function FORKS on each call. In layman's
terms, that means that it fires up another copy of "sendmail", a very large
and complex program FOR EACH MAIL. Compare this to, say, firing up
Microsoft Word on a PC to send each and every email. Needless to say, this
simply WILL NOT scale up well.
You *can* dink around with timing to try and get mail() to not be
over-loaded, but, really, that's just not going to cut it.
Your next "crank it up a notch, Emril" (sp?) option is to talk directly to
your SMTP server. This is not rocket science. You use
http://php.net/fsockopen to the server on port 25, and then you fputs/fgets
things like:
"HELO yourserver.com"
"FRM: [EMAIL PROTECTED]"
There's well-documented series of things you are expected to fputs to the
server, and responses with error code numbers you are expected to get back.
I posted a minimalist sample of how to do this, oh, a couple months ago.
However, you *can* use Manuel Lemos' class to deal with it instead, or some
other mail package that talks directly to your SMTP server and that may be
way easier.
That said: *UNLESS* you really, really, need PHP to dynamically create the
newsletter content on a person-by-person basis, your *BEST* option is to
not use PHP to send the email at all.
You can use PHP to compose the email. You can even use PHP to compose the
recipient list on-the-fly and save it where the mailing list software needs
it.
But you really, really, really should be using custom mailing list software
for mass emails if you want to keep your server not over-loaded.
For starters, the mailing list software code is written in C and has been
optimized for longer than PHP has existed, so it goes fast.
Secondly, the programs themselves do things that make the email get out in
a timely fashion -- For example: Big-time mailing list software will
*SORT* the outgoing email by destination address. So all the AOL.com
emails will go out, then all the ABC.com emails, ... up through all the
Yahoo.com emails. Why? Because at some point, *YOUR* SMTP server has to
talk to *THEIR* SMTP server (and/or via other servers that can intermediate
for them) and if the emails are sorted by destination, then the software
can just keep talking to the same server without re-connecting (or, at
least, the connection will likely be in a cache somewhere and re-used).
Actually, I don't even know the details of why it goes faster, I just know
it does. It's this kind of thing that has kept mailing list software
writers up at night, and the PHP Development team (rightly) ignores, as
it's not within the realm of what PHP needs to focus on.
> And, unfortunately, it's not one of those types of technical
> challenges you can keep testing over and over without seriously
> annoying the first 100 or so people on your list who *do* get the
> email before the script times out.
So send it to made-up emails, or get yourself a throw-away domain name on a
cheap-o ISP with unlimited email forwarding and make up 40,000 email
addresses randomly. (Make *SURE* the ISP knows and agrees to be the
"victim" of this test of 40,000 emails every day for testing purposes!!!)
It won't be a *REAL* test, since all the emails are going to the same
destination, but it's going to be pretty close.
> I think the amount of trash email I get each day proves that vast
> mailings aren't TOO difficult, but I think I could use a little
> wisdom before I give it a shot.
Bottom Line: PHP is the wrong weapon.
> Anyone? I'll buy you a coke!
Buy a CD instead :-) [see below]
--
Like music? http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]