note 7871 added to imap_mailboxmsginfo

From: Date: Thu, 17 Aug 2000 23:20:24 +0000
Subject: note 7871 added to imap_mailboxmsginfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-2250@lists.php.net to get a copy of this message
I tried many ways, it seems only return the information about 'INBOX", anyway because it only check the current mailbox, then I tried to open another stream for it, but seems in one page only can open one imap stream, it always return the same result, I am curious, why not change this function , and let it like the imap_status have more parameters, then user can tell it which mailbox it should look at. <? $server="hostname"; $name="user"; $passwd="passwprd"; $mbox = imap_open("{".$server."}","$name","$passwd",OP_HALFOPEN) || die("can't connect: ".imap_last_error()); $list = imap_getmailboxes($mbox,"{".$server."}","%"); if(is_array($list)) { reset($list); while (list($key, $val) = each($list)) { $folder=$val->name; $mbox1 = imap_open("{".$server."}".$folder,"$name","$passwd",OP_HALFOPEN) || die("can't connect: ".imap_last_error()); $check = imap_mailboxmsginfo($mbox1); if($check) { $messages= $check->Nmsgs; $recent = $check->Recent; $unread = $check->Unread; $size = $check->Size; echo "(1)".$folder."|".$messages."|".$recent."|".$unread."|".$size; } else { print "imap_check() failed: ".imap_lasterror(). "<br>\n"; } imap_close($mbox1); } } else { print "imap_getmailboxes failed: ".imap_last_error()."\n"; } imap_close($mbox); ?> I got the error: Warning: Unable to find stream pointer in /home/otherways/htdocs/webmail/test.php on line 14 http://www.php.net/manual/function.imap-mailboxmsginfo.php

« previous php.notes (#2250) next »