[thelist] scripts performing email merge

Juha Suni juha.suni at ilmiantajat.fi
Fri Feb 11 08:06:54 CST 2005

Kristy Frey wrote:
> Suppose I have a php script that reads records from a database.  For
> each row it gets email_address and first_name.  Then the script does
> something like this with each row:
> $message_body = "Dear $first_name, \n".$message_body;
> mail($email_address, "Some Newsletter", $message_body);
> Without knowing web server specs or database specs, what do you think
> would be a reasonable rate at which a script like this should send
> emails?  10 per minute, 100 per minute, 1000 per minute, ...?

As others have pointed out, this can be affected by numerous things, but
here is some comparison:

Our 2 year old "ok"-class dedicated webserver pushes out mass emails (just
using the method you described: looping through mail with some parsing per
client) at the rate of about 2-3 per second. 95% of the time seems to spend
looping the actual mail-function. Database calls and parsing count very
little in the overall overhead. This is all without any special
optimizations, since our lists consist typically of less than 1000 people.

I am confident that even with little optimization (perhaps a shell script
intended for this purpose) the speed would increase dramatically.


More information about the thelist mailing list