|
Posted by Mike Willbanks on 12/07/05 05:21
Bob,
Is set_time_limit() what you are looking for? timeout() is not a function.
The best was would seem to basically sent the email out to multiples at
once as you can do that if you interface with the mailer itself.
Then what you might think about doing is looping and increasing the
timeout per each item ex:
while(list($key, $val) = each($emails)) {
set_time_limit(3); //give it 3 seconds per each email
mail(....);
}
You could try set_time_limit(0) but I wouldn't recommend that as if you
have something caught in a loop somewhere and it is just hanging you
might as well let it terminate.
Mike
> I've seen many implementations of the timeout hack when sending a lot of
> emails.
>
> I can't set the timeout variable, as it's timeout(0) doesn't work, I
> still have 30 seconds.
>
> I've to send many emails with attached file, so it will take more time
> when the server is hardloaded, and I can't have a Cron job to do things.
>
> What's the best way ? the simplest seems to be the "location" to the
> script itself with in the parameter the last email used for sending the
> email.
> It's viable ? should it work always ? Should I instead refresh at any
> sent email ? what's the best way, on the server side I can change nothing !
>
> Thanks in advance.
>
> Bob
>
[Back to original message]
|