smtp : if there is an error with the server, send QUIT and close correctely the connection

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3291 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-12-14 07:15:33 +00:00
parent 131c3d6ee2
commit 46650ef970

View File

@@ -225,6 +225,8 @@ class smtp
if (substr ($line, 0, 1) !== "2" && substr ($line, 0, 1) !== "3")
{
$this->debug ("Can't send mail : server answer : $line\n");
$this->putLine ("QUIT\r\n");
fclose ($this->smtpStream);
throw new \Exception ("Can't send mail : server answer : $line", 500);
}
return $content;