Mail::send() doesn't close smtp connection
| From: | Stepan Vorobyov | Date: | Thu, 22 Jan 2015 17:24:13 +0000 |
| Subject: | Mail::send() doesn't close smtp connection | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-31977@lists.php.net to get a copy of this message | ||
I repeat this message because the previous one had Content-Transfer-Encoding: base64 and was not displayed properly in web interface http://news.php.net/php.pear.general/31973
Hello!
I use Mail::send() with smtp backend to send mails from php script on my FreeBSD server.
It works fine when everyting is ok.
But if there's an error (E.g. SMTP authentication failure) Mail::send() finishes with error and leaves tcp connection with smtp server open.
Is this a feature or bug?
My script tried to send thousands of mails and thus hit the system limit of open files (network connection is concidered as an open file). As a result other services (such as database) became unavailable too.
So... Is it the right behavior for Mail::send() not to close the connection?
Thanks.