Hello,

On 12/21/2002 08:10 PM, Jonathan Chum wrote:
An upcoming project I'm working and spec'ing out is a mass mailing
application. Initially, I was looking at Mailman which was written in Python
since it looks like it handles delivering emails efficiently without killing
the server. We have 1 client able to send 110,000 emails at 6.5K avg per
week on PIII 800 with 128 MB RAM using Mailman. The inteface however is very
bad and we'd like to develop other features like text ads, tracking,
templates, etc. This would require writing a wrapper around Mailman in PHP.
I was considering of writing the mass mailing application in PHP instead
though.

If anyone has eperience writing such applications with this amount of
emails, I'd like to know what you've done.
If you do not need to send personalized messages (messages that differ for each recipient), just put all recipients in a BCc: header and send a single message to the local mailer queue (not via SMTP).

If you do not care for the users that bounce messages, just make the return path be black hole email address. OTOH, if you care about bounces (you should if you mailing list is large or is not clean), consider using ezmlm, which is a mailing list manager than among other things takes care of bounce messages thanks to qmail VERP. I was told that is the one that eGroups hacked to use in the now known YahooGroups site.

Once I built a small Web interface for ezmlm. It was meant just to create and edit several mailing lists meant to be used as newsletter for a portal with many sites. Is simple but it already comes with a SOAP interface to manage the mailing list subscribers remotely.

http://www.phpclasses.org/ezmlmmanager


I'm thinking of coding the front end in PHP that will put the email into a
queue table that will force a command line PHP script listening on a
particular port to scan the database for this new task in queue. Once it
picks up the task, the timeout for this application to run will be set to
infinite. It'll establish a SMTP socket either to a really beefed up mailing
list server or the localhost SMTP server to begin blasting out these emails.

From what I understand, it's better to blast emails via an open socket
connection to SMTP rather than looping through Sendmail. Is this the right
thing todo?
No, queuing via SMTP is the slowest way to send messages. Your script should not bother to deliver the messages to the recipients SMTP servers. Delivery can take hours or days to finish due to network congestions and hard to conect SMTP servers. Just queue the messages in the local mailer and let it take care the actual delivery.

I would recommend a qmail based system anytime, with or without ezmlm on top. In a production system that I manage, it just takes 3 seconds to queue a alert message to be sent to 50,000 via a local qmail server.

You can also use sendmail almost as fast using the queue only mode. Some people think that sendmail is slow and many forks processes because they are not aware of how to configure it to queue the messages the fastest way that is possible.

You may want to look into this class that has a sub-classes for delivering with sendmail program directly instead of using the mail(). It lets you configure the sendmail delivery mode. There is also a sub-class for delivering with qmail.

http://www.phpclasses.org/mimemessage



I've also heard that PHP is not good for writing mailing lists application,
but Mailman is written in Python and it's able to send thousands of email
just fine. Any thoughts on this?
When people do not know how to do it properly, they blame it on the software. Note down: *smart software always beats fast software*. Sure you can use a faster language like C (not Python), but if you develop smart software in PHP it can be almost as fast as a similar solution in C and does not take an etternity to develop and debug.


--

Regards,
Manuel Lemos


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to