RE: [PHP-WIN] mail to too many users
| From: | Symeon Charalabides | Date: | Tue, 29 Jan 2002 16:11:18 +0000 |
| Subject: | RE: [PHP-WIN] mail to too many users | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11694@lists.php.net to get a copy of this message | ||
> >>> "Jim Lucas [php]" <jimphp@bend.com> 01/28/02 03:47PM >>>
> with php's mail() funciton you can send to multiple recipents via the
> headers. just build the headers so it will BCC to everybody at once.
> one word of caution, you can only have a header that is 5kb or
> smaller.
> otherwise php will start truncating the header. Found that out the
> hard
> way.
>
> so, just build a big header and send out 300 at a time.
>
It's not like the messages will not still be placed in the job queue, or that the
server will not have to parse each address one by one, if they're in the Cc or
BCc header: you may as well place the addresses in the To: field, separated by
commas for all the difference it will make.
Sending them out in lumps of 100s is likely to be more server-friendly, though.
Can you schedule the equivalent of a Cron job on IIS?
Have you experimented with the PHP 'sleep' and 'usleep' functions? Maybe you
can give the server time to catch its breath this way...
>
>
> > I need to send an email to 19000 users using a script, any
> suggestions.
> > Looping on a result set using the mail function would kill the
> server.
> > I know it can be done using a mailing list module but I'm running a
> > windows machine with IIS, what's the best thing for this? Thanks.
> >
Symeon Charalabides (cosmopolitan trainee)
------------------------------------------
Rm 305, IT centre, NUI Galway, Ireland.
+353-91-524411 x3180
http://www.it.nuigalway.ie/~symeon/