PHP.nl

imap_fetch_overview

imap_fetch_overview

Read an overview of the information in the headers of the given message

 **imap_fetch_overview** IMAP\Connection $imap string $sequence int $flags

This function fetches mail headers for the given and returns an overview of their contents. sequence

sequence A message sequence description. You can enumerate desired messages with the syntax, or retrieve all messages within an interval with the syntax X,Y``X:Y

flags will contain a sequence of message indices or UIDs, if this parameter is set to . sequence``FT_UID

Returns an array of objects describing one message header each. The object will only define a property if it exists. The possible properties are:

The function returns false on failure.

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

    Voorbeeld: example

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

$MC = imap_check($mbox);

// Fetch an overview for all messages in INBOX
$result = imap_fetch_overview($mbox,"1:{$MC->Nmsgs}",0);
foreach ($result as $overview) {
    echo "#{$overview->msgno} ({$overview->date}) - From: {$overview->from}
    {$overview->subject}\n";
}
imap_close($mbox);
?>

imap_fetchheader