IMAP, POP3 및 NNTP imap_mailboxmsginfo

(PHP 4, PHP 5, PHP 7, PHP 8)

imap_mailboxmsginfo — 현재 사서함에 대한 정보 가져오기


설명

imap_mailboxmsginfo(IMAP\Connection $imap): stdClass

서버의 현재 사서함 상태를 확인합니다. imap_status()와 유사하지만 사서함에 있는 모든 메시지의 크기를 추가로 합산하므로 실행하는 데 추가 시간이 걸립니다.


매개변수

imap
IMAP\Connection 인스턴스입니다.

반환 값

다음 속성을 가진 개체의 정보를 반환합니다.

Mailbox properties

Date date of last change (current datetime)
Driver driver
Mailbox name of the mailbox
Nmsgs number of messages
Recent number of recent messages
Unread number of unread messages
Deleted number of deleted messages
Size mailbox size

실패 시 false를 반환합니다.


변경 로그

버전 설명
8.1.0 imap 매개변수는 이제 IMAP\Connection 인스턴스를 필요로 합니다. 이전에는 리소스가 필요했습니다.

Examples

예제 #1 imap_mailboxmsginfo() 예제

                  
<?php

$mbox = imap_open("{imap.example.org}INBOX", "username", "password")
      or die("can't connect: " . imap_last_error());

$check = imap_mailboxmsginfo($mbox);

if ($check) {
    echo "Date: "     . $check->Date    . "<br />\n" ;
    echo "Driver: "   . $check->Driver  . "<br />\n" ;
    echo "Mailbox: "  . $check->Mailbox . "<br />\n" ;
    echo "Messages: " . $check->Nmsgs   . "<br />\n" ;
    echo "Recent: "   . $check->Recent  . "<br />\n" ;
    echo "Unread: "   . $check->Unread  . "<br />\n" ;
    echo "Deleted: "  . $check->Deleted . "<br />\n" ;
    echo "Size: "     . $check->Size    . "<br />\n" ;
} else {
    echo "imap_mailboxmsginfo() failed: " . imap_last_error() . "<br />\n";
}

imap_close($mbox);

?>