/** * Class destructor to ensure all open connections are closed * * @return void */ public function __destruct() { if ($this->_connection instanceof SmtpProtocol\Smtp) { try { $this->_connection->quit(); } catch (Protocol\Exception $e) { // ignore } $this->_connection->disconnect(); } }