email timeout

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've seen many implementations of the timeout hack when sending a lot of  

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.


Re: email timeout


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

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.


Quoted text here. Click to load it

Re: email timeout

Hi Mike, thanks for answer,

Quoted text here. Click to load it
Yes, it's set_time_limit(), but as said, I can't use this function, as it  
has been disabled by the hosting service, for avoiding infinite loop that  
may slow down entire server (mutual server for now, but planning to go  

So I must find a solution without using set_time_limit.... and sending one  
email to any address using it in TO: field, as putting in BCC will result  
many emails will be simply be detected as spam.

Any idea ?  

Site Timeline