imap_mailboxmsginfo

(PHP 3>= 3.0.2, PHP 4 )

imap_mailboxmsginfo -- 현재 메일박스에 관한 정보를 가져온다

Description

object imap_mailboxmsginfo ( int imap_stream)

현재 메일박스에 관한 정보를 돌려준다. 실패하면 FALSE를 리턴한다.

imap_mailboxmsginfo()함수는 서버에서 현재 메일박스의 상태를 점검한다. 이 함수는 imap_status()함수와 유사하다. 단지 메일박스안의 모든 메시지 사이즈의 총량을 내는 것이 추가되었다. 이것은 곧 총량을 내기위해 실행할 추가적인 시간이 걸린다는 것을 의미한다. 다음 속성을 갖는 객체로 정보를 돌려준다.

표 1. Mailbox properties

Datedate of last change
Driverdriver
Mailboxname of the mailbox
Nmsgsnumber of messages
Recentnumber of recent messages
Unreadnumber of unread messages
Deletednumber of deleted messages
Sizemailbox size

예 1. imap_mailboxmsginfo() example

<?php

$mbox = imap_open("{your.imap.host}INBOX","username", "password")
      || die("can't connect: ".imap_last_error());
 
$check = imap_mailboxmsginfo($mbox);
 
if($check) {
    print "Date: "    . $check->Date    ."<br>\n" ;
    print "Driver: "  . $check->Driver  ."<br>\n" ;
    print "Mailbox: " . $check->Mailbox ."<br>\n" ;
    print "Messages: ". $check->Nmsgs   ."<br>\n" ;
    print "Recent: "  . $check->Recent  ."<br>\n" ;
    print "Unread: "  . $check->Unread  ."<br>\n" ;
    print "Deleted: " . $check->Deleted ."<br>\n" ;
    print "Size: "    . $check->Size    ."<br>\n" ;
} else {
    print "imap_check() failed: ".imap_last_error(). "<br>\n";
}
 
imap_close($mbox);

?>