Mail::send() doesn't close smtp connection
| From: | Stepan Vorobyov | Date: | Sat, 17 Jan 2015 07:20:09 +0000 |
| Subject: | Mail::send() doesn't close smtp connection | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-31973@lists.php.net to get a copy of this message | ||
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 behaviour for Mail::send() not to close the connection?
Thanks.