On Mon, 13 Sep 2004 17:55:36 +0200, Damien <truc@bidule.net> wrote:
[color=blue]
>Ian.H a écrit :
>(snip)[color=green]
>>
>> You could break it into batches.. I did this a week ago for a client but
>> may depend on exactly what kind of queries are being run. If they're
>> relatively "simple"[1] there should be no problem doing that.[/color]
>
>Actually, based on my "chronoscript", what's costing me time is the
>mail() function, not the queries I make in order to prepare the mail
>being sent.
>[color=green]
>>
>> I wrote a simple "pagination" function that then worked out the starting
>> record for the SQL query and displayed a 'prev | next' page link (I
>> actually used the code from a Smarty plugin I wrote.. the 'prev' link
>> may not be necessary etc) but this then worked no problem for about
>> 15,000 entries =)
>>[/color]
>Problem with my script is that the loop generates the elements from what
>is posted by a form: recipient list, message. So I'm afraid I'm going to
>have troubles breaking the receipients into batches unless I store them
>in a table first.
>
>Hmmm, guess I've got some DB filling ahead ;) . Any other idea ?
>
>Thanks for the tips anyway !
>Damien[/color]
Damien, are the bodies of the mail the same? or are they "personalised"?
I'm assuming that you're firing off multiple mails using mail() sending
by only the 'TO' header. Have you thought about the loop generating a CC
header? (or BCC.. but not sure how many these days reject BCC'd mail due
to abuse). This would result in just one mail actually being processed
to be sent but with multiple recipients which may cure your mail()
bottleneck.
There are a few issues to maybe take into account here though regarding
my suggestions.. as mentioned, BCC has become an "easy abuse method" and
some admins drop these mails. Likewise, too many recipients in the CC
header and the mail will also be rejected.
Not knowing the exact workings of your structure.. these ideas maybe
null&void.. but _might_ be an alternative option =)
Regards,
Ian
--
Ian.H
digiServ Network
London, UK
http://digiserv.net/