Re: PEAR::Mail, how to send newsletters?
| From: | brian | Date: | Wed, 24 Jan 2007 18:08:28 +0000 |
| Subject: | Re: PEAR::Mail, how to send newsletters? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26412@lists.php.net to get a copy of this message | ||
Leo Márquez wrote:
Hi, I want to send a newsletter to 4000 recipients but my server says me: SMTP: Invalid response code received from server (code: 421, response: 4.3.2 Too many open connections.) Then I think I'm not doing a god job. I use Mail ans Mail_mime to send the newsletter that is in html format. I have tried it making one instance of the class for each recipient and sending one mail for each recipient.This is your problem. It's a very innefficient way to do it because you're calling your MTA for every single address.
But I also have tried to chunk my recipients array and send emails to 50 recipients in each loop. I use the smtp option with autentication and the persists option set to true. There is a way to do this job more efficiently ? I don't know if I get this error from server from previeous tests this afternoon. Tomorrow I'll do more tests.A better way to handle this would be to use something like Mailman[1], PHPMailer[2], PHPList[3], or the like. Another option is Swift Mailer[4]. [1] http://www.gnu.org/software/mailman/ (i've used this successfully) [2] http://phpmailer.sourceforge.net/ (i've played with this a bit) [3] http://www.phplist.com/ (i've never used this) [4] http://www.swiftmailer.org/ (i've used this successfully) b