diff --git a/src/Smtp.php b/src/Smtp.php index 72fe45f..da70cde 100644 --- a/src/Smtp.php +++ b/src/Smtp.php @@ -106,6 +106,7 @@ class Smtp if ($errstr === "" && $php_errormsg !== "") { $errstr = $php_errormsg; } + $this->smtpStream = null; throw new \Exception(sprintf(dgettext( "domframework", "Can't connect to SMTP server : %s" @@ -139,6 +140,7 @@ class Smtp ) === false ) { + $this->smtpStream = null; throw new \Exception(sprintf(dgettext( "domframework", "Can't activate STARTTLS %s" @@ -148,6 +150,7 @@ class Smtp $this->debug("STARTTLS ACTIVATED\n"); } } elseif ($this->starttls === "encrypt") { + $this->smtpStream = null; throw new \Exception(dgettext( "domframework", "Server doesn't supports STARTTLS" @@ -170,6 +173,7 @@ class Smtp $this->putLine("AUTH LOGIN " . base64_encode($this->user) . "\r\n"); $this->putLine(base64_encode($this->password) . "\r\n"); } else { + $this->smtpStream = null; throw new \Exception( dgettext( "domframework",