public function logout()
{
if (!is_null($this->_extensions) && $this->_connection->connected) {
try {
// See RFC 5321 [4.1.1.10]
$this->_connection->write('QUIT');
$this->_getResponse(221);
} catch (Exception $e) {
}
$this->_connection->close();
}
unset($this->_connection);
$this->_extensions = null;
}