Forum und email

imap_fetch_overview

(PHP 4, PHP 5)

imap_fetch_overview — 주어진 메시지 헤더의 전체 정보를 읽어 온다

Description

array imap_fetch_overview ( int $imap_stream , string $sequence [, int $flags ] )

이 함수는 주어진 sequence 일련번호에 대한 헤더를 페치하고, 전체 정보를 돌려준다. sequence 값은 flags 가 FT_UID를 갖는다면 UID나 메시지 인덱스(indices)의 일련번호(sequence)가 된다. 돌려받는 값은 메시지 헤더의 각각을 서술하는 다음과 같은 속성을 갖는 객체의 배열이다:

  • subject - the messages subject
  • from - who sent it
  • date - when was it sent
  • message_id - Message-ID
  • references - is a reference to this message id
  • size - size in bytes
  • uid - UID the message has in the mailbox
  • msgno - message sequence number in the maibox
  • recent - this message is flagged as recent
  • flagged - this message is flagged
  • answered - this message is flagged as answered
  • deleted - this message is flagged for deletion
  • seen - this message is flagged as already read
  • draft - this message is flagged as being a draft

Example#1 imap_fetch_overview() example

$mbox = imap_open("{your.imap.host:143}","username","password")
     || die("can't connect: ".imap_last_error());
 
$overview = imap_fetch_overview($mbox,"2,4:6",0);
 
if(is_array($overview)) {
        reset($overview);
        while( list($key,$val) = each($overview)) {
                print     $val->msgno
                . " - " . $val->date
                . " - " . $val->subject
                . "\n";
        }
}
 
imap_close($mbox);