imap_status

(PHP3 >= 3.0.4, PHP4 )

imap_status --  This function returns status information on a mailbox other than the current one

Description

object imap_status (int imap_stream, string mailbox, int options)

This function returns an object containing status information. Valid flags are:

status->flags is also set, which contains a bitmask which can be checked against any of the above constants.

Példa 1. imap_status() example

  1 
  2 $mbox = imap_open("{your.imap.host}","username","password",OP_HALFOPEN)
  3       || die("can't connect: ".imap_last_error());
  4  
  5 $status = imap_status($mbox,"{your.imap.host}INBOX",SA_ALL);
  6 if($status) {
  7   print("Messages:   ". $status->messages   )."<br>\n";
  8   print("Recent:     ". $status->recent     )."<br>\n";
  9   print("Unseen:     ". $status->unseen     )."<br>\n";
 10   print("UIDnext:    ". $status->uidnext    )."<br>\n";
 11   print("UIDvalidity:". $status->uidvalidity)."<br>\n"; 
 12 } else
 13   print "imap_status failed: ".imap_lasterror()."\n";
 14  
 15 imap_close($mbox);
 16