public function getPendingMessages() { $messages = array(); // connect to the server to grab all messages Loader::library('3rdparty/Zend/Mail/Storage/Pop3'); $args = array('host' => $this->miServer, 'user' => $this->miUsername, 'password' => $this->miPassword); if ($this->miEncryption != '') { $args['ssl'] = $this->miEncryption; } if ($this->miPort > 0) { $args['port'] = $this->miPort; } $mail = new Zend_Mail_Storage_Pop3($args); for ($i = 1; $i <= $mail->countMessages(); $i++) { $mim = new MailImportedMessage($mail, $mail->getMessage($i), $i); $messages[] = $mim; } return $messages; }
public function testDotMessage() { $mail = new Zend_Mail_Storage_Pop3($this->_params); $content = ''; $content .= "Before the dot\r\n"; $content .= ".\r\n"; $content .= "is after the dot\r\n"; $this->assertEquals($mail->getMessage(7)->getContent(), $content); }
public function testRequestAfterClose() { $mail = new Zend_Mail_Storage_Pop3($this->_params); $mail->close(); try { $mail->getMessage(1); } catch (Exception $e) { return; // test ok } $this->fail('no exception raised while requesting after closing connection'); }