scott wrote:

>My mail function is sending out a few hundred or so mail address but
>keeps hanging when it gets to sending a mail form a certain domain.
Probably DNS. Try doing a "dig" (assuming linux) on the 
domain it is going to. I suspect there is not an entry thus it will hang 
until DNS times out.

>As the script hangs at this point I can't send anymore mails once the
>script encounters an address from x domain. What would be the best way
>to work around this? Why is mail() hanging? 
In my opinion, if you are sending all the emails from a single PHP 
script, do one per script (depends upon how the maximum execution time 
works). Or use cron/at to do it outside of waiting for a web page. I 
admit that I use perl for this part, calling it from "at".

>How would you suggest incorporating a timeout so that the script
>continues once mail() has not exited for more than say 5 seconds????
mail() is a blocking call, so it won't exit until it has either 
successfully sent an email or has failed.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to