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