another tips is to get only total number of message and recent message
$imap_obj = imap_status($mbox, '{mail.mysrv.com:143/imap}INBOX', SA_MESSAGES+SA_RECENT);
echo('<pre>'); var_dump($imap_obj); echo('</pre>');
imap_status
(PHP 4, PHP 5)
imap_status — Esta función devuelve el información de estado de otro buzón distinto al actual.
Descripción
object imap_status
( int $imap_stream
, string $mailbox
, int $options
)
Esta función devuelve un objeto que contiene información de estado. Las opciones válidas son:
- SA_MESSAGES - activa status->messages con el número de mensajes en el buzon
- SA_RECENT - activa status->recent con el número de mensajes recientes en el buzón
- SA_UNSEEN - activa status->unseen con el número de mesajes no leidos (nuevos) en el buzón
- SA_UIDNEXT - activa status->uidnext con el próximo uid a usar en el bizón
- SA_UIDVALIDITY - activa status->uidvalidity con una constante que cambia cuando los uids del buzon ya no son válidos
- SA_ALL - activa todos los de arriba
status->flags contienen una máscara de bits la cual puede ser comprobada contra cualquiera de las propiedades de arriba.
imap_status
razonklnbd at hotmail dot com
05-Jan-2008 10:12
05-Jan-2008 10:12
jille at DIESPAMMERShexon dot cx
03-May-2007 06:21
03-May-2007 06:21
In 'reply' to my previous post;
I`m not sure of that anymore
I think this trick works,
but the rest of my script just sucks..
Conclusion:
You can get the last UID by using status->uidnext-1
BUT: This is not a good way, if another message is added after your append and before your status; you are screwed
