fetchFlags() public method

This method supports unique IDs instead of message numbers. See {@link ezcMailImapTransportOptions} for how to enable unique IDs referencing. $messages is an array of message numbers, for example: array( 1, 2, 4 ); The format of the returned array is: array( message_number => array( flags ) ) Before calling this method, a connection to the IMAP server must be established and a user must be authenticated successfully, and a mailbox must be selected. Example: $imap = new ezcMailImapTransport( 'imap.example.com' ); $imap->authenticate( 'username', 'password' ); $imap->selectMailbox( 'mailbox' ); // Inbox or another mailbox $flags = $imap->fetchFlags( array( 1, 2, 4 ) ); The returned array $flags will be something like: array( 1 => array( '\Seen' ), 2 => array( '\Seen' ), 4 => array( '\Seen', 'NonJunk' ) );
public fetchFlags ( array $messages ) : array(mixed)
$messages array
return array(mixed)
コード例 #1
0
 public function testUidFetchFlagsNotSelected()
 {
     $imap = new ezcMailImapTransport(self::$server, self::$port, array('uidReferencing' => true));
     $imap->authenticate(self::$user, self::$password);
     try {
         $imap->fetchFlags(self::$ids);
         $this->fail("Expected exception was not thrown.");
     } catch (ezcMailTransportException $e) {
     }
 }
コード例 #2
0
 public function testFetchFlagsNotSelected()
 {
     $imap = new ezcMailImapTransport(self::$server, self::$port);
     $imap->authenticate(self::$user, self::$password);
     try {
         $imap->fetchFlags(array(1, 2, 3, 4));
         $this->fail("Expected exception was not thrown.");
     } catch (ezcMailTransportException $e) {
     }
 }