PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




imap_fetch_overview

Name

imap_fetch_overview — Get overview information contained in the headers of the message.

Synopsis

array imap_fetch_overview(connection, message[, flags]);
int connection: IMAP connection ID
string message: Message sequence
int flags (optional): Option flags

Returns

An array of overview information; FALSE on error

Description

Returns an array of information about a sequence of messages. The sequence is a comma serperated list of message. To retrieve a range of messages, seperate the beginning and end of the range by a colon.

Each element of the array is an object. The properties of the object are:

subject Message subject
from Sender's address
to To address
date Message date
message_id Message ID
size Message size in bytes
uid Message mailbox UID
msgno Message sequence number in the maibox
recent Message flagged as recent
flagged Message is flagged
answered Message has been answered
deleted Message has been marked for deletion
seen Message has been read
draft Message is marked as being a draft


Note

As from versions 3.0.4 and 4.0

See also

See also: imap_fetchstructure, imap_headers

Example

Example 601. Display formatted message information

<?php
$imap = imap_open("{localhost}INBOX","graeme","inferno");

// fetch message information for message 2
// and messages 4 to 6
$info = imap_fetch_overview($imap, "2,4:6");

?>

<table border=1>
<tr><th>Read</th><th>From</th><th>Date</th><th>Subject</th></tr>

<?php
// loop through the array
foreach ($info as $msg) {
   echo "<tr>";

   // display the seen property nicely
   if ($msg->seen == 1) {
      $read = "Yes";
   } else {
      $read = "No";
   }

   // print other message information
   printf("<td>%s</td>", $read);
   printf("<td>%s</td>", $msg->from);
   printf("<td>%s</td>", $msg->date);
   printf("<td>%s</td>", $msg->subject);
}

imap_close($imap);
?>



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.