Re: note 9591 added to imap_check

From: Date: Tue, 14 Nov 2000 07:41:46 +0000
Subject: Re: note 9591 added to imap_check
References: 1 2  Groups: php.notes 
Request: Send a blank email to php-notes+get-7664@lists.php.net to get a copy of this message
Hartmut Holzgraefe wrote: > as 'recent' is defined as > "arrived in the mailbox since the previous time the mailbox was opened", > you don't have to blame imap_check() but imap_open() instead > > i assume what you are really looking for is the unseen property returned > by imap_status() ... ? oh, and by the way: imap_status() will return the 'recent' count for a mailbox too, and if you pass it only the SA_RECENT flag it should not even reset this value as it does not have to open the mailbox for this operation but if you add the SA_USEEN flag it might have to open the mailbox (this is implementation dependant) thus resetting the recent counter once again so if you really just want to get the recent count, you should do a <?php $mail_connection=imap_open("{server}INBOX","user","password",OP_HALFOPEN); $res = imap_status($mail_connection,"{server}mailbox",SA_RECENT); echo "Recent: ".$res->recent; imap_close($mail_connection); ?> -- Harmut Holzgraefe hartmut@six.de

« previous php.notes (#7664) next »