Voting

: max(eight, two)?
(Example: nine)

The Note You're Voting On

mwwaygoo AT hotmail DOT com
12 years ago
I had issues with imap_status not working correctly, while other imap functions seemed okay. I always got the ['flags']=0 response. No notes here and Google searching suggests it doesn't working properly with Exchange, so I wrote a little workaround, to at least get some information.

<?php
function my_imap_status($stream, $mailbox='', $info=SA_ALL)
{
// get current mailbox name (and info)
$curr_obj=imap_check($stream);
if(!
$curr_obj) return false;

// if request if for current mailbox then just return it
if( (empty($mailbox)) || ($mailbox==$curr_obj->Mailbox) ) return $curr_obj;

// get current mailbox
$current_mailbox=$curr_obj->Mailbox;

//switch to new mailbox
if(!imap_reopen($stream, $mailbox)) return false;

// get info
$obj=imap_check($stream);

// switch back to original mailbox
imap_reopen($stream, $current_mailbox);

//return info
return $obj;
}
?>

<< Back to user notes page

To Top