Re: Batch E-Mail Problem
| From: | Manuel Lemos | Date: | Thu, 15 Aug 2002 05:10:59 +0000 |
| Subject: | Re: Batch E-Mail Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112688@lists.php.net to get a copy of this message | ||
Hello,
On 08/14/2002 08:54 PM, Daren Cotter wrote:
I have a PHP script that queries a MySQL database, retrieves email addresses, and sends an email to all members of a website. The problem is this: the PHP script times out after sending about 5,000 mailings, and I have to restart it 10 times in order to mail the entire list! This is an ongoing problem I have had for almost a year now. I have tried MANY things to make this work better, which I have outlined below: 1) Upped the Max Excecution Time in PHP from 30 to a ridiculously high 300 (is this a security issue?) 2) Upped the Max amount of memory a PHP script can have from 8mb to 16mb 3) Running sendmail in "deferred" mode instead of "background" mode, and processing the mail queue ever 5 minutes instead of the default 1 hour.Your problem is that your solution does not scale well. A much more scalable solution is to put all recipients in BCC: and just send one message. It just takes a few seconds to run that. -- Regards, Manuel Lemos