note 27651 rejected from function.imap-status by jmcastagnetto

From: Date: Sat, 14 Dec 2002 01:42:27 +0000
Subject: note 27651 rejected from function.imap-status by jmcastagnetto
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40896@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

« previous php.notes (#40896) next »