<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.imap-fetch-overview" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>imap_fetch_overview</refname>
  <refpurpose>Read an overview of the information in the headers of the given message</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type class="union"><type>array</type><type>false</type></type><methodname>imap_fetch_overview</methodname>
   <methodparam><type>IMAP\Connection</type><parameter>imap</parameter></methodparam>
   <methodparam><type>string</type><parameter>sequence</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
  <para>
   This function fetches mail headers for the given
   <parameter>sequence</parameter> and returns an overview of their
   contents.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    &imap.imap-parameter.imap;
    <varlistentry>
     <term><parameter>sequence</parameter></term>
     <listitem>
      <para>
       A message sequence description. You can enumerate desired messages
       with the <literal>X,Y</literal> syntax, or retrieve all messages 
       within an interval with the <literal>X:Y</literal> syntax
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>flags</parameter></term>
     <listitem>
      <para>
       <parameter>sequence</parameter> will contain a sequence of message
       indices or UIDs, if this parameter is set to 
       <constant>FT_UID</constant>. 
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an array of objects describing one message header each.
   The object will only define a property if it exists. The possible
   properties are:
   <itemizedlist>
    <listitem>
     <simpara>
      <literal>subject</literal> - the messages subject
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>from</literal> - who sent it
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>to</literal> - recipient
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>date</literal> - when was it sent
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>message_id</literal> - Message-ID
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>references</literal> - is a reference to this message id
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>in_reply_to</literal> - is a reply to this message id
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>size</literal> - size in bytes
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>uid</literal> - UID the message has in the mailbox
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>msgno</literal> - message sequence number in the mailbox
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>recent</literal> - this message is flagged as recent
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>flagged</literal> -  this message is flagged
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>answered</literal> -  this message is flagged as answered
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>deleted</literal> -  this message is flagged for deletion
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>seen</literal> -  this message is flagged as already read
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>draft</literal> -  this message is flagged as being a draft
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      <literal>udate</literal> -  the UNIX timestamp of the arrival date
     </simpara>
    </listitem>
   </itemizedlist>
   The function returns &false; on failure.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     &imap.changelog.imap-param;
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>imap_fetch_overview</function> example</title>
    <programlisting role="php">
<![CDATA[
<?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);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>imap_fetchheader</function></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
