From 46650ef97032d0b2c80f3ecc0c13b033bddffc3e Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 14 Dec 2016 07:15:33 +0000 Subject: [PATCH] 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 --- smtp.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smtp.php b/smtp.php index af09740..c24b88a 100644 --- a/smtp.php +++ b/smtp.php @@ -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;