Forum Moderators: coopster
$boxes = imap_getmailboxes($mbox, "{mail.domain.com}", "*");foreach($boxes as $val) {
$piece1 = explode("}", $val->name);
$piece2 = explode(".", $piece1[1]);if (empty($piece2[1])) {echo '<div><b>Inbox</b></div>';}
Could someone please give me some direction as to what part of IMAP I should use to determine the message count and unread message count per folder?
- John
I've been trying to make a function to make the folder count dynamic (from when I create a folder list). Toward the top where I define the $status with imap_status I'm trying to dynamically choose the folder (through using the PHP function's parameter). I sued both single and double quotes as well as attempting to use concatenation. Suggestions?
- John
function email_folder_count($folder)
{
$status = imap_status($mbox, '{mail.domain.com}$folder', SA_ALL);
if ($status)
{
echo "Messages: " . $status->messages . "<br />\n";
echo "Unseen: " . $status->unseen . "<br />\n";
}
else
{
echo "imap_status failed: " . imap_last_error() . "\n";
}
}email_folder_count('INBOX');
How do I use multiple imap_status flags? For example I don't need all of the data, just SA_MESSAGES and SA_UNSEEN.
I've tried concatenation and using a comma...I think something else too...not quite sure and there is only one example (of course) on php.net.
- John