PHP 4.0 Bug #6250 Updated: imap_open can't open any other mailfolder than "INBOX"
| From: | Bug Database | Date: | Sat, 19 Aug 2000 01:39:06 +0000 |
| Subject: | PHP 4.0 Bug #6250 Updated: imap_open can't open any other mailfolder than "INBOX" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-29627@lists.php.net to get a copy of this message | ||
ID: 6250
User Update by: eric@otherways.com
Status: Feedback
Bug Type: IMAP related
Description: imap_open can't open any other mailfolder than "INBOX"
yeah, It was my mistake, could you please colse this bug ticket. sorry for that.
anyway, I do have a problem about the imap_mailboxmsginfo, I know probably this is not place to ask
this question, but I am anxious to get answer, if you think it is not proper, just delete my new
comment.
I tried to display all mailboxes information in on e page, but the following scripts doesn't
work.
does one page only can open one stream?
<?
$server="server";
$name="name";
$passwd="password";
$mbox = imap_open("{".$server."}","$name","$passwd") ||
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
"(".$key.")".$folder."|".$messages."|".$recent."|".$unread."|".$size."<br>";
}
else {
print "imap_check() failed: ".imap_lasterror(). "<br>\n";
}
imap_close($mbox1);
}
}
else
{
print "imap_getmailboxes failed: ".imap_last_error()."\n";
}
imap_close($mbox);
?>
Full Bug description available at: http://bugs.php.net/?id=6250