if (!$this->_check($msg)) { $this->error = $msg; return false; } } //This deletes any messages marked for deletion, and then logs you off of the mail server. //This is the last command to use. This does not disconnect you from the ISP, just the mailbox. public function pQUIT() { $this->_write('QUIT'); $msg = $this->_read(); if (!$this->_check($msg)) { $this->error = $msg; return false; } } public function __destruct() { fclose($this->fd); } } //EXAMPLE: $pop3 = new POP3(); $pop3->pUSERPASS('tieto', '123456'); if ($pop3->error) { echo 'ERROR: ' . $pop3->error; exit(0); } $messages = $pop3->pLIST(); echo $pop3->pRETR(1); $pop3->pQUIT();