/** * Class destructor to ensure all open connections are closed * * @return void */ public function __destruct() { if ($this->connection instanceof SmtpProtocol) { try { $this->connection->quit(); } catch (Protocol\Exception $e) { // ignore } $this->connection->disconnect(); } }
/** * Class destructor to ensure all open connections are closed */ public function __destruct() { if ($this->connection instanceof Protocol\Smtp) { try { $this->connection->quit(); } catch (ProtocolException\ExceptionInterface $e) { // ignore } if ($this->autoDisconnect) { $this->connection->disconnect(); } } }
public function quit() { $this->calledQuit = true; parent::quit(); }