Re: [PHP] Re: Mass Mailing Using PHP

2004-09-29 Thread Manuel Lemos
Hello,
On 09/28/2004 03:54 AM, Roger Thomas wrote:
You may just need to tune qmail to maximize the number of
simultaneous deliveries according to the available bandwidth.

How do I tune qmail in that manner ? If the answer is too long and
complicated, pls flame me softly as this is already OT.
Usually, increasing the concurrencyremote control option is what makes 
most of the difference. The default is 20 simultaneous deliveries. You 
can increase to 120 without patching qmail. If you realize that such 
change exhausts your memory, you may have to use a smaller value.

Using a DNS query caching daemon also helps if your DNS is a little slow 
to react.


For this reason, during deliveries of messages to many recipients,
it is better to pause once in a while to let the queue be fully
processed and do not stall other programs.

Do you mean, say we fetched 100,000 addresses from database, we make
our script sleep for a while after sending, say 1000 mails ?
Right, you need to test with qmail-qstat how long it needs to rest to 
give qmail time to process all queued messages during a period. This is 
may also be important if your available disk space is limited.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Mass Mailing Using PHP

2004-09-28 Thread Paul Bissex
On Tue, 28 Sep 2004 14:54:24 +0800, Roger Thomas <[EMAIL PROTECTED]> wrote:
> Quoting Manuel Lemos <[EMAIL PROTECTED]>:
> > For this reason, during deliveries of messages to many recipients, it is better to 
> > pause once in a while to let the queue be fully processed and do not stall other 
> > programs.
> 
> Do you mean, say we fetched 100,000 addresses from database, we make our script 
> sleep for a while after sending, say 1000 mails ?

An alternative solution is to insert a small delay using usleep()
after each message is sent such that the queue never gets overfull to
begin with. Also, keep in mind you are dealing with multiple possible
constraints -- local resource limitations (CPU & disk), and bandwidth
available for connecting to remote hosts.

For reference, I do this kind of thing on a fairly busy server, using
Postfix, for nonprofit clients that do member newsletter mailings in
the 5,000 to 10,000 piece range. I find that I am able to keep system
load tolerably low by limiting my script to about 3-4 messages per
second. In my case I am mostly concerned about managing local CPU. The
queue never backs up.

You will also want to look at protecting your script from dying
prematurely by using ignore_user_abort() and set_time_limit() or
equivalents.

If you are sending only a few hundred messages, that shouldn't place
much of a burden on your server, and you may not need to insert any
delay at all.

(Whereas if you are sending 100,000 messages, I'd have to guess you're
a spammer, as any org with a legitimate reason to mail 100K people at
once would be unlikely to be creating this script from scratch and
asking basic questions in php-general. But I could be wrong.)

good luck,

pb

-- 
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N

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



Re: [PHP] Re: Mass Mailing Using PHP

2004-09-28 Thread Roger Thomas
Quoting Manuel Lemos <[EMAIL PROTECTED]>:

> You may just need to tune qmail to maximize the number of simultaneous deliveries 
> according to the available bandwidth.

How do I tune qmail in that manner ? If the answer is too long and complicated, pls 
flame me softly as this is already OT.
 
> For this reason, during deliveries of messages to many recipients, it is better to 
> pause once in a while to let the queue be fully processed and do not stall other 
> programs.

Do you mean, say we fetched 100,000 addresses from database, we make our script sleep 
for a while after sending, say 1000 mails ?

--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] Re: Mass Mailing Using PHP

2004-09-27 Thread Manuel Lemos
Hello,
On 09/27/2004 09:02 PM, Roger Thomas wrote:
Just let me know which OS and local mailer (Sendmail, qmail, postfix, 
exim, MS IIS, Exchange, etc..) do you use so I can advise.

What do you recommend for Linux and qmail combination ?
Please advise.
Under Linux qmail or postfix are just fine. You can use the mail 
function and it will use qmail. You may just need to tune qmail to 
maximize the number of simultaneous deliveries according to the 
available bandwidth.

Just keep in mind that qmail will queue every message that it receives, 
either from local clients or incoming via SMTP. This means that your 
incoming and outgoing messages will compete in the same queue. If you 
have urgent messages to send or receive, these may be delayed during 
deliveries to many recipients.

For this reason, during deliveries of messages to many recipients, it is 
better to pause once in a while to let the queue be fully processed and 
do not stall other programs.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Mass Mailing Using PHP

2004-09-27 Thread Roger Thomas
Quoting Manuel Lemos <[EMAIL PROTECTED]>:

> Just let me know which OS and local mailer (Sendmail, qmail, postfix, 
> exim, MS IIS, Exchange, etc..) do you use so I can advise.

What do you recommend for Linux and qmail combination ?
Please advise.


--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] Re: Mass Mailing

2003-01-26 Thread Manuel Lemos
Hello,

On 01/23/2003 02:40 AM, Jonathan Chum wrote:

Anyway, the problem of personalizing messages is that makes your
mailings take much longer to generate and queue because you need to
create separate message for each recipient.



I'm weighing down personalization and enveloping for this project, and
probably going for the personalization of each email. This rules out BCC and
enveloping with SMTP.


I always advise people to not bother personalizing messages for silly 
purposes like starting messages like this:

Dear ,

The problem is that this is now a pattern of spam that people are so 
much used to it that they no longer can be fooled into believing that 
the messages was really written by a human being to them and not some 
spam script.

It was told that spam detection programs like SpamAssassin give extra 
spam points to messages that have phrases like that.


OTOH, there are more reasonable motives to personalize messages like the 
silly decision of Hotmail to have default spam filter rule to reject 
messages that do not have a visible To: or Cc: header with the recipient 
address of the Hotmail account.

The decision is silly because it makes it consider most real opt-in 
mailing lists like this one, php-general, as spam, which is obviously a 
big mistake.

Anyway, since most Hotmail users with that filtering rule on are not 
aware, it makes sense to personalize just the To: header with each 
recipient address. You do not have to personalize the body though. So, I 
have just added an option to cache the message body between deliveries 
of the same message to different recipies using this MIME message 
composing and sending class. See the personalized bulk mail example for 
more details:

http://www.phpclassses.org/mimemessage


and run it every hour.


With qmail you do not have to run the queue like sendmail. You just
inject the messages and it will deliver them when possible.



If it delivers when possible, won't the server flake if it get's 100,000
emails inject into Qmail? If I was to use your class and loop through
100,000 emails into Qmail, will Qmail attempt all at once?


No, qmail only attempts to send upto a limited number of messages 
simultaneously which defaults to 20, but if you have good link you can 
raise it upto 120. Raising it further will not work unless you apply a 
patch to qmail.

Anyway, the down side of injecting that many messages in qmail queue, 
either separately or a single message with Bcc:, is that it will choke 
the incoming message reception because the SMTP server delivers the 
messages to the local queue too.

There are 2 solutions for this: if you have a spare server machine, use 
it as relay and configure qmail control value smtproutes pointing to the 
spare server that will do the actual delivery. If you do not have a 
spare server, you need to just inject a few messages at a time and rest 
for a period of time that is enough to let the messages already inthe 
queue be flushed. Even with a spare server, it is a good idea to rest 
after delivering a few hundred messages.


In that case, you may consider QMQP relay which is a protocol that lets
you rely entire mail queues from a server to another. This is
recommended when you have many busy mailing lists served from one
machine and you can use more servers do the actual delivery. I think
only qmail and ezmlm support QMQP.



Thanks, I'll check QMQP as well.


If you really want personalization, QMQP is not really useful because it 
is meant to shift queues of single messages to many recipients. 
Personalization turns it into many messages to distinct recipients.


The greatest problem that made me learn some hard lessons is that it is
very problematic if you start with subscribers list that are not clean
up of no longer valid users. Once you start delivering messages to those
addresses, you get a flood of bounces that pratically stop your server
queue.

The MTV newsletter was weekly, but that affected the newsletters of
other sites that were stopped during the MTV newsletter bounces. Since
ezmlm does not unsubscribe bouncing addresses right away, the solution
was to remove bouncing subscribers using an external validation
procedure. I used this other class for the cleanup. After that it was a
breeze. We had peaks of 10,000 messages sent per minute.

http://www.phpclasses.org/emailvalidation



We had a 72K list with about 6K bad emails that Mailman didn't unsubscribe
until we used MojoMail which unsubscribes them from the database instantly
as well as perform validations. Now, blasts are handled alot quicker.


That is not a good idea either because you are delisting people that are 
temporarily bouncing as if their addresses are permanently invalid which 
is not the case.



So far, you have given me a good case to use Qmail and using your PHP class
as a foundation for this application. . . I'll have to check the other
software recommendations you made and see how'd I incorporate this into the
application.

B

Re: [PHP] Re: Mass Mailing

2003-01-22 Thread Evan Nemerson
Q
If it delivers when possible, won't the server flake if it get's 100,000
emails inject into Qmail? If I was to use your class and loop through
100,000 emails into Qmail, will Qmail attempt all at once?

A
The answer was right above the question... "With qmail you do not have to run 
the queue like sendmail. You just inject the messages and it will deliver 
them when possible." It will build up a queue of everything it needs to send, 
then send them one at a time (or ten, or a hundred- you can configure 
that...) until it's done. It will never DoS itself by trying to send 10K 
eMails at once. Think of the queue as a long line. Mail waits its turn, then 
gets attention when it reaches the front of the line.


Q
BTW, isn't there any overhead associating with opening/closing a connection
to inject each email into Qmail? Or it's very minimal overhead to even worry
about? If 100,000 was looped and injected into Qmail, is Qmail fast enough
that 100,000 emails are not just sitting on the server filling up disk
space?

A
It's more than worth the overhead to use qmail. Basically, qmail does all the 
hard work for you. First of all, it sends multiple messages at once (default 
is 20, but it's configurable), so you're connection is never idle waiting for 
that SYN|ACK, DNS query, SMTP acknowledgement, etc.  Now theoretically 
_could_ do this with PHP (pcntl), but why re-invent the MTA? It probably 
wouldn't be nearly as efficient, and it would take an eternity to develope a 
script that even approaches qmail's functionality.


Now, with regards to a MLM (mailing list manager), you may want to take a look 
at ezmlm. You can find it (and qmail) at http://cr.yp.to/ It doesn't just 
delete addresses from the database automatically, but first sends a little 
probe eMail, threatening to delete the address if the probe bounces. It's a 
pretty cool feature, since it prevents good addresses from being dropped for 
stupid reasons. For instance, I get them sometimes (securityfocus runs ezmlm 
on bugtraq and vuln-dev, prolly their others too, and vulnwatch/vulndev both 
use it) when mail bounces due to MIME types that can be naughty (exe, vbs, 
com, eml, hehe .fon, .ttf, .otf soon?), or when someone uses profanity, or 
even if the DNS was temporarily down. Now personally i don't care about 
profanity or naughty MIME types, but lots of ISPs (like mine) filter them. 
Just something to think about.



On Wednesday 22 January 2003 08:40 pm, Jonathan Chum wrote:
> Hi,
>
> I was surfing through google's archive, and some reason my USENET reader
> didn't catch this reply, so here goes. . .(my comments are embedded below)
>
> "Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hello,
> >
> > On 12/22/2002 02:52 PM, Jonathan Chum wrote:
> > >>>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 heard that using BCC, it can only handle a certain amount of
>
> receipients.
>
> > No, if you look in the archives of this list you will notice that this
> > was explained several times. What happens is that some ISP of shared
> > hosting limit the number of recipients of the messages you can send
> > because they do not want you to do mass mailing at all. You should check
> > your ISP Acceptable Use Policy before trying to do any mass mailing.
> > Trying to queue individual messages to each recipient may fool the
> > server limitations but you may still be against the AUP.
> >
> > > Also, messages that are BCC'd are also tend to be blocked by mail
>
> servers
>
> > > and clients.
> >
> > Any server owners that do that are dumb because while they think they
> > are blocking spammers, what they get is they are simply blocking opt-in
> > mailing lists for instance like this 

[PHP] Re: Mass Mailing

2003-01-22 Thread Jonathan Chum
Hi,

I was surfing through google's archive, and some reason my USENET reader
didn't catch this reply, so here goes. . .(my comments are embedded below)

"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> On 12/22/2002 02:52 PM, Jonathan Chum wrote:
> >>>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 heard that using BCC, it can only handle a certain amount of
receipients.
>
> No, if you look in the archives of this list you will notice that this
> was explained several times. What happens is that some ISP of shared
> hosting limit the number of recipients of the messages you can send
> because they do not want you to do mass mailing at all. You should check
> your ISP Acceptable Use Policy before trying to do any mass mailing.
> Trying to queue individual messages to each recipient may fool the
> server limitations but you may still be against the AUP.
>
>
> > Also, messages that are BCC'd are also tend to be blocked by mail
servers
> > and clients.
>
> Any server owners that do that are dumb because while they think they
> are blocking spammers, what they get is they are simply blocking opt-in
> mailing lists for instance like this one you are getting. At the same
> time you still keep getting most of the spam because real spammers use
> dedicated machines make the recipients addresses show in the messages as
> needed to defeat that silly anti-spam criteria. So, what they get is to
> block solicited e-mail.
>
> Anyway, the problem of personalizing messages is that makes your
> mailings take much longer to generate and queue because you need to
> create separate message for each recipient.

I'm weighing down personalization and enveloping for this project, and
probably going for the personalization of each email. This rules out BCC and
enveloping with SMTP.

>
> >>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 was looking at a variety of methods, and seems that everyone thinks
for
> > best performance, you would inject the email in to Qmail or Sendmail's
queue
>
> That is because it is really the best.

:) Sounds good, definately going with Qmail on this project...


> > and run it every hour.
>
> With qmail you do not have to run the queue like sendmail. You just
> inject the messages and it will deliver them when possible.

If it delivers when possible, won't the server flake if it get's 100,000
emails inject into Qmail? If I was to use your class and loop through
100,000 emails into Qmail, will Qmail attempt all at once?

> > As for SMTP, I meant sending the email through your outbound SMTP server
> > which in our case, a server we build specifically for handling that sort
of
>
> Of course al

[PHP] Re: Mass-mailing method

2003-01-02 Thread Manuel Lemos
Hello,

On 01/03/2003 04:08 AM, Cesar Aracena wrote:

I did a registration page for a customer, and now I'm trying to develop
a way for him to send an e-mail once in a while to the people registered
with him. I did something (shown below) and everything seems to be ok,
but the e-mail never reaches... Can someone find the problem or maybe
point me to something already done to send multiple e-mails as BCC???


I think Bcc: addresses have to be separated with commas (,). If that is 
not the problem, you may want to try this class that has built-in some 
workarounds that solve non-obvious quirks of using the mail() function. 
I use it to deliver in average 2 million message a month most of them 
with tens of thousands of recipients in Bcc:.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos


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



Re: [PHP] Re: Mass Mailing

2002-12-26 Thread peter a

Hi.
I have myself written a rather clumsy mass mailer in
php which queues mail via the sendmail-command.
I have found this to be rather slow and ineffective.

You are talking about queueing mail directly to the
mailqueue, and I wonder, how is that done with php?

About making mails not rejected by spam-filters I have
experienced that there should be something in the to
field, many servers are rejecting mails that it empty in
that header. Also, if you are sending out html letters,
try and attach a plain text version as well, or emails
will be rejected as well. I have a rather neat script
for the latter if anybody is interested.

But please get back with some tips how to queue mail
straight to the mail queue for fast delievery.

  /peter a



At 2002-12-22 20:52, Manuel Lemos wrote:
>Hello,
>
>On 12/22/2002 02:52 PM, Jonathan Chum wrote:
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 heard that using BCC, it can only handle a certain amount of receipients.
>
>No, if you look in the archives of this list you will notice that this was explained 
>several times. What happens is that some ISP of shared hosting limit the number of 
>recipients of the messages you can send because they do not want you to do mass 
>mailing at all. You should check your ISP Acceptable Use Policy before trying to do 
>any mass mailing. Trying to queue individual messages to each recipient may fool the 
>server limitations but you may still be against the AUP.
>
>
>>Also, messages that are BCC'd are also tend to be blocked by mail servers
>>and clients.
>
>Any server owners that do that are dumb because while they think they are blocking 
>spammers, what they get is they are simply blocking opt-in mailing lists for instance 
>like this one you are getting. At the same time you still keep getting most of the 
>spam because real spammers use dedicated machines make the recipients addresses show 
>in the messages as needed to defeat that silly anti-spam criteria. So, what they get 
>is to block solicited e-mail.
>
>Anyway, the problem of personalizing messages is that makes your mailings take much 
>longer to generate and queue because you need to create separate message for each 
>recipient.
>
>
>>>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 was looking at a variety of methods, and seems that everyone thinks for
>>best performance, you would inject the email in to Qmail or Sendmail's queue
>
>That is because it is really the best.
>
>
>>and run it every hour.
>
>With qmail you do not have to run the queue like sendmail. You just inject the 
>messages and it will deliver them when possible.
>
>
>
>
>>As for SMTP, I meant sending the email through your outbound SMTP server
>>which in our case, a server we build specifically for h

[PHP] Re: Mass Mailing

2002-12-22 Thread Manuel Lemos
Hello,

On 12/22/2002 02:52 PM, Jonathan Chum wrote:

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 heard that using BCC, it can only handle a certain amount of receipients.


No, if you look in the archives of this list you will notice that this 
was explained several times. What happens is that some ISP of shared 
hosting limit the number of recipients of the messages you can send 
because they do not want you to do mass mailing at all. You should check 
your ISP Acceptable Use Policy before trying to do any mass mailing. 
Trying to queue individual messages to each recipient may fool the 
server limitations but you may still be against the AUP.


Also, messages that are BCC'd are also tend to be blocked by mail servers
and clients.


Any server owners that do that are dumb because while they think they 
are blocking spammers, what they get is they are simply blocking opt-in 
mailing lists for instance like this one you are getting. At the same 
time you still keep getting most of the spam because real spammers use 
dedicated machines make the recipients addresses show in the messages as 
needed to defeat that silly anti-spam criteria. So, what they get is to 
block solicited e-mail.

Anyway, the problem of personalizing messages is that makes your 
mailings take much longer to generate and queue because you need to 
create separate message for each recipient.


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 was looking at a variety of methods, and seems that everyone thinks for
best performance, you would inject the email in to Qmail or Sendmail's queue


That is because it is really the best.



and run it every hour.


With qmail you do not have to run the queue like sendmail. You just 
inject the messages and it will deliver them when possible.




As for SMTP, I meant sending the email through your outbound SMTP server
which in our case, a server we build specifically for handling that sort of


Of course all e-mail is delivered to each recipient via SMTP, but that 
you can relay to your local mailer.


volume. I was reading through Perl's BulkMail module,
http://mojo.skazat.com/support/documentation/Bulkmail.pm.html

They are using SMTP to delivery their emails. Using envelopes and sorting
the emails by their host meant even faster delivery. Though the envelope


That would be a good idea if you have messages to be sent to many 
recipients of the same domain but in reality it is more problematic. 
Some servers indeed reject messages to be sent many recipients at once. 
Although that is not illegal, it is a pattern of spamming. Another 
problem, is that you will have an hard time distinguishing which 
addresses of a same domain are bouncing and which are not bouncing.


method seems to be like BCC as you can't personalized each email To:
recepient.


If you want delivery efficiency, forget personalization.



Your Mime Message clas

[PHP] Re: Mass Mailing

2002-12-22 Thread Jonathan Chum
Thanks Manuel,

"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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 heard that using BCC, it can only handle a certain amount of receipients.
Also, messages that are BCC'd are also tend to be blocked by mail servers
and clients.

> > 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 was looking at a variety of methods, and seems that everyone thinks for
best performance, you would inject the email in to Qmail or Sendmail's queue
and run it every hour.

As for SMTP, I meant sending the email through your outbound SMTP server
which in our case, a server we build specifically for handling that sort of
volume. I was reading through Perl's BulkMail module,
http://mojo.skazat.com/support/documentation/Bulkmail.pm.html

They are using SMTP to delivery their emails. Using envelopes and sorting
the emails by their host meant even faster delivery. Though the envelope
method seems to be like BCC as you can't personalized each email To:
recepient.

Your Mime Message class seems to be better for sending mass mailings as it
queues up the email into Sendmail without opening/closing the connection for
each recepient. phpmailer.sourceforget.net has that problem of opening and
closing a connection, yet they claim to receive good results of up to 40,000
emails per hour. Another software using that class was able to send 500,000
emails in 10 hours.

> > I've also heard that PHP is not good for writing mailing lists
application,
> > but Mailman is written in Python and it

[PHP] Re: Mass Mailing

2002-12-21 Thread Manuel Lemos
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



[PHP] Re: Mass Mailing

2001-12-03 Thread Manuel Lemos

Hello,

Nathan Cavicchi wrote:
> 
> I started writing a set of scripts that would send out mutiple emails to a
> list of customers.  I then realized that most likely this program, and/or
> snipits had most likely already been written.  If so, can some one point me
> in the right direction and save me 3 or 4 days?

Forget PHP. Use a dedicated mailing list or e-mail server. If you are
using Unix, I recommend strongly qmail/ezmlm. It is very good for
handling bounces. I use it to distribute PHP Classes site notification
messages. It is very fast and pratical. You may want to try this PHP Web
interface for managing ezmlm mailing lists. It even comes with a SOAP
interface for managing subscriptions programmatically eventually from a
remote machine.

http://phpclasses.UpperDesign.com/browse.html/package/177

Regards,
Manuel Lemos

-- 
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]