Jump to content

PHP mail() method timeout?


anita999

Recommended Posts

I have been using the PHP mail() method to send email using an SMTP server installed on my machine. For the most part it worked well.  But lately, it seems to timeout after 30 seconds.  Other times, it seems to sit there and I can see an email has been sent but when I check the return value of mail() it looks like it has failed.  It seems a bit flaky.  I want to narrow down whether it is the PHP function or the SMTP server I have installed.  Can anyone tell me if there is anything special to make mail() work or if I need to increase a timeout value and how.

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/48835-php-mail-method-timeout/
Share on other sites

The mail is un-relaible when it comes to returning true or flase. Which is why you generally see people code to not rely on that method.

 

As for the timeout issue, I would check the SMTP server, maybe the load/queue is getting too cumbersome.

 

I would recommend using PEAR::Mail() for a very nice mail handling queue system.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.