note 27651 added to function.imap-status

From: Date: Sat, 14 Dec 2002 01:02:48 +0000
Subject: note 27651 added to function.imap-status
Groups: php.notes 
Request: Send a blank email to php-notes+get-40895@lists.php.net to get a copy of this message
i am just learn Php to make email client.. and i got problem.. i can detect new message . I use mail_status function to count new message ... --------------------------------------------------- $mbox = imap_open("{your.imap.host}","username","password",OP_HALFOPEN) or die("can't connect: ".imap_last_error()); $status = imap_status($mbox,"{your.imap.host}INBOX",SA_ALL); if($status) { print("Messages: ". $status->messages )."<br>\n"; print("Recent: ". $status->recent )."<br>\n"; print("Unseen: ". $status->unseen )."<br>\n"; print("UIDnext: ". $status->uidnext )."<br>\n"; print("UIDvalidity:". $status->uidvalidity)."<br>\n"; } else print "imap_status failed: ".imap_last_error()."\n"; imap_close($mbox); ------------------------------------------------- and then $new_message = $status_recent + $status->unseen ---------------------------------------------------------- i had tried for another alternative.. looping whole the message.. and then check from the header->unseen == ""U and header->Recent == "R", if true $new variable will plus one But i find fail.. it's not work at all -- http://www.php.net/manual/en/function.imap-status.php http://master.php.net/manage/user-notes.php?action=edit+27651 http://master.php.net/manage/user-notes.php?action=delete+27651 http://master.php.net/manage/user-notes.php?action=reject+27651

« previous php.notes (#40895) next »