[prog] Mailing list software - how does the emailing work? (mass bcc?)

Kathryn Hogg kjh at flyballdogs.com
Tue May 10 16:20:23 EST 2005


Gareth Anderson said:
> However my aim is to use PHP mail() function to do the mailing.
>
> However I have read "Web-based PHP scripts aren't designed to run for
> long periods of time (the default execution time is 30 seconds), and
> this presents a problem if you need to send a weekly newsletter to a
> large number of recipients."

You can set the execution time in the php program itself.  I have one
script that can take several minutes to run (it imports some ugly data).
Look at the set_time_limit() function.

>
> This is what I'm attempting to do.
>
> I've also read that I could use
> http://www.phpguru.org/static/htmlMimeMail5.html to send to multiple
> recipients (although I will be using the PHP4 version)
>
> However, is there any recommendations about this?

It looks like a fairly plain wrapper around mail().

> Will I hit a timeout when I run my script to send the email out to say
> 500 people? Although I assume that would be upto the server, is there
> a way around this limitation?

I don't think you'll actually be delivering the messages yourself. 
Instead it will take as long as firing off say 500 sendmails.   You can do
this one of two ways  1) send it individually to the 500 recipients 2)
split them into batches.

Method number one is brain dead simple. #2 is a little more problematic. 
You probably don't want everyone in a batch to see all the other
recipients in a batch.  I work around that by setting the To address to
and address that I know will just discard it.  Then I Bcc all the
addresses in my batch, So if my batch size is 25 emails, it will only take
20 calls to mail() to send them.  That should take almost no time.

> Do I need to communicate directly with the SMTP server?

Why would you want to when PHP has built in functions to send emails?

> I'm assuming that its more efficient to use htmlMimeMail and use BCC
> to send to several people at once rather than sending to each person
> one at a time using php's mail function? (is this correct?)

I read the documentation you linked to above and it appears that the class
mentioned is a wrapper around php's mail (and a couple of other delivery
methods)



-- 
Kathryn
http://womensfooty.com



More information about the Programming mailing list