Ejemplo n.º 1
0
	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;
	}
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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');
 }