[PHP-DOC] cvs: phpdoc /it/functions imap.xml From: Luca Perugini (l.perugini <email protected>)
Date: 08/31/00

perugini Thu Aug 31 09:41:50 2000 EDT

  Modified files:
    /phpdoc/it/functions imap.xml
  Log:
  Sync with en tree.
  
  
Index: phpdoc/it/functions/imap.xml
diff -u phpdoc/it/functions/imap.xml:1.5 phpdoc/it/functions/imap.xml:1.6
--- phpdoc/it/functions/imap.xml:1.5 Sat Jun 24 00:38:44 2000
+++ phpdoc/it/functions/imap.xml Thu Aug 31 09:41:50 2000
@@ -31,47 +31,47 @@
     <itemizedlist>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc821.html">RFC821</ulink>:
+ <ulink url="&url.rfc;rfc821.html">RFC821</ulink>:
        Simple Mail Transfer Protocol (SMTP).
       </simpara>
      </listitem>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc822.html">RFC822</ulink>:
+ <ulink url="&url.rfc;rfc822.html">RFC822</ulink>:
        Standard for ARPA internet text messages.
       </simpara>
      </listitem>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc2060.html">RFC2060</ulink>:
+ <ulink url="&url.rfc;rfc2060.html">RFC2060</ulink>:
        Internet Message Access Protocol (IMAP) Version 4rev1.
       </simpara>
      </listitem>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc1939.html">RFC1939</ulink>:
+ <ulink url="&url.rfc;rfc1939.html">RFC1939</ulink>:
        Post Office Protocol Version 3 (POP3).
       </simpara>
      </listitem>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc977.html">RFC977</ulink>:
+ <ulink url="&url.rfc;rfc977.html">RFC977</ulink>:
        Network News Transfer Protocol (NNTP).
       </simpara>
      </listitem>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc2076.html">RFC2076</ulink>:
+ <ulink url="&url.rfc;rfc2076.html">RFC2076</ulink>:
        Common Internet Message Headers.
       </simpara>
      </listitem>
      <listitem>
       <simpara>
- <ulink url="&url.rfc;/rfc2045.html">RFC2045</ulink> ,
- <ulink url="&url.rfc;/rfc2046.html">RFC2046</ulink> ,
- <ulink url="&url.rfc;/rfc2047.html">RFC2047</ulink> ,
- <ulink url="&url.rfc;/rfc2048.html">RFC2048</ulink> &amp;
- <ulink url="&url.rfc;/rfc2049.html">RFC2049</ulink>:
+ <ulink url="&url.rfc;rfc2045.html">RFC2045</ulink> ,
+ <ulink url="&url.rfc;rfc2046.html">RFC2046</ulink> ,
+ <ulink url="&url.rfc;rfc2047.html">RFC2047</ulink> ,
+ <ulink url="&url.rfc;rfc2048.html">RFC2048</ulink> &amp;
+ <ulink url="&url.rfc;rfc2049.html">RFC2049</ulink>:
        Multipurpose Internet Mail Extensions (MIME).
       </simpara>
      </listitem>
@@ -158,35 +158,12 @@
     </funcsynopsis>
     <para>
      <function>imap_base64</function> function decodes BASE-64 encoded
- text (see <ulink url="&url.rfc;/rfc2045.html">RFC2045</ulink>,
+ text (see <ulink url="&url.rfc;rfc2045.html">RFC2045</ulink>,
      Section 6.8). The decoded message is returned as a string.
     </para>
     <para>
      See also <function>imap_binary</function>.
     </para>
- <para>
- <example>
- <title><function>imap_mailboxmsginfo</function> example</title>
- <programlisting role="php">
-$mbox = imap_open("{your.imap.host}INBOX","username", "password")
- || die("can't connect: ".imap_last_error());
-
-$check = imap_mailboxmsginfo($mbox);
-
-if($check) {
- print "Date: " . $check->Date ."&lt;br>\n" ;
- print "Driver: " . $check->Driver ."&lt;br>\n" ;
- print "Mailbox: " . $check->Mailbox ."&lt;br>\n" ;
- print "Messages: ". $check->Nmsgs ."&lt;br>\n" ;
- print "Recent: " . $check->Recent ."&lt;br>\n" ;
- print "Size: " . $check->Size ."&lt;br>\n" ;
-} else
- print "imap_check() failed: ".imap_lasterror(). "&lt;br>\n";
-
-imap_close($mbox);
- </programlisting>
- </example>
- </para>
    </refsect1>
   </refentry>
 
@@ -348,7 +325,7 @@
      || die("can't connect: ".imap_last_error());
 
 $name1 = "phpnewbox";
-$name2 = imap_utf7_encode("phpnewböx");
+$name2 = imap_utf7_encode("phpnewb&ouml;x");
 
 $newname = $name1;
 
@@ -427,6 +404,25 @@
      <function>imap_close</function> is called with the optional
      parameter CL_EXPUNGE.
     </para>
+ <para>
+ <example>
+ <title><function>Imap_delete</function> Beispiel</title>
+ <programlisting role="php">
+$mbox = imap_open ("{your.imap.host}INBOX", "username", "password")
+ || die ("can't connect: " . imap_last_error());
+
+$check = imap_mailboxmsginfo ($mbox);
+print "Messages before delete: " . $check->Nmsgs . "&lt;br>\n" ;
+imap_delete ($mbox, 1);
+$check = imap_mailboxmsginfo ($mbox);
+print "Messages after delete: " . $check->Nmsgs . "&lt;br>\n" ;
+imap_expunge ($mbox);
+$check = imap_mailboxmsginfo ($mbox);
+print "Messages after expunge: " . $check->Nmsgs . "&lt;br>\n" ;
+imap_close ($mbox);
+ </programlisting>
+ </example>
+ </para>
    </refsect1>
   </refentry>
 
@@ -454,7 +450,7 @@
     </para>
     <para>
      See also <function>imap_createmailbox</function>,
- <function>imap_reanmemailbox</function>, and
+ <function>imap_renamemailbox</function>, and
      <function>imap_open</function> for the format of
      <parameter>mbox</parameter>.
     </para>
@@ -477,7 +473,7 @@
     <para>
      <function>imap_expunge</function> deletes all the messages marked
      for deletion by <function>imap_delete</function>,
- <function>imap_move_mail</function>, or
+ <function>imap_mail_move</function>, or
      <function>imap_setflag_full</function>.
     </para>
     <para>
@@ -629,14 +625,7 @@
          <entry>True if the dparameters array exists</entry>
         </row>
         <row>
- <entry>dparameters
- <footnote>
- <para>
- dparameters is an array of objects where each object has
- an "attribute" and a "value" property.
- </para>
- </footnote>
- </entry>
+ <entry>dparameters</entry>
          <entry>Disposition parameter array</entry>
         </row>
         <row>
@@ -644,32 +633,40 @@
          <entry>True if the parameters array exists</entry>
         </row>
         <row>
- <entry>parameters
- <footnote>
- <para>
- Parameter is an array of objects where each object has an
- "attributte" and a "value" property.
- </para>
- </footnote>
- </entry>
+ <entry>parameters</entry>
          <entry><acronym>MIME</acronym> parameters array</entry>
         </row>
         <row>
- <entry>parts
- <footnote>
- <para>
- Parts is an array of objects identical in structure to the
- top-level object, with the limitation that it cannot
- contain further 'parts' objects.
- </para>
- </footnote>
- </entry>
+ <entry>parts</entry>
          <entry>Array of objects describing each message part</entry>
         </row>
        </tbody>
       </tgroup>
      </table>
     </para>
+ <note>
+ <orderedlist>
+ <listitem>
+ <para>
+ dparameters is an array of objects where each object has an
+ "attribute" and a "value" property.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Parameter is an array of objects where each object has an
+ "attributte" and a "value" property.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Parts is an array of objects identical in structure to the
+ top-level object, with the limitation that it cannot contain
+ further 'parts' objects.
+ </para>
+ </listitem>
+ </orderedlist>
+ </note>
     <para>
      <table>
        <title>Primary body type</title>
@@ -1084,7 +1081,7 @@
      Copies mail messages specified by <parameter>msglist</parameter>
      to specified mailbox. <parameter>msglist</parameter> is a range
      not just message numbers (as described in
- <ulink url="&url.rfc;/rfc2060.html">RFC2060</ulink>).
+ <ulink url="&url.rfc;rfc2060.html">RFC2060</ulink>).
     </para>
     <para>
      Flags is a bitmask of one or more of
@@ -1127,7 +1124,7 @@
      Moves mail messages specified by <parameter>msglist</parameter>
      to specified mailbox. <parameter>msglist</parameter> is a range
      not just message numbers (as described in
- <ulink url="&url.rfc;/rfc2060.html">RFC2060</ulink>).
+ <ulink url="&url.rfc;rfc2060.html">RFC2060</ulink>).
     </para>
     <para>
      Flags is a bitmask and may contain the single option
@@ -1375,7 +1372,7 @@
     <funcsynopsis>
      <funcprototype>
       <funcdef>int <function>imap_reopen</function></funcdef>
- <paramdef>string <parameter>imap_stream</parameter></paramdef>
+ <paramdef>int <parameter>imap_stream</parameter></paramdef>
       <paramdef>string <parameter>mailbox</parameter></paramdef>
       <paramdef>string
        <parameter><optional>flags</optional></parameter>
@@ -1510,7 +1507,7 @@
     </funcsynopsis>
     <para>
      Convert a quoted-printable string to an 8 bit string (according
- to <ulink url="&url.rfc;/rfc2045.html">RFC2045</ulink>, section
+ to <ulink url="&url.rfc;rfc2045.html">RFC2045</ulink>, section
      6.7).
     </para>
     <para>
@@ -1539,7 +1536,7 @@
     </funcsynopsis>
     <para>
      Convert an 8bit string to a quoted-printable string (according to
- <ulink url="&url.rfc;/rfc2045.html">RFC2045</ulink>, section
+ <ulink url="&url.rfc;rfc2045.html">RFC2045</ulink>, section
      6.7).
     </para>
     <para>
@@ -1568,7 +1565,7 @@
     </funcsynopsis>
     <para>
      Convert an 8bit string to a base64 string (according to <ulink
- url="&url.rfc;/rfc2045.html">RFC2045</ulink>, Section 6.8).
+ url="&url.rfc;rfc2045.html">RFC2045</ulink>, Section 6.8).
     </para>
     <para>
      Returns a base64 string.
@@ -1661,6 +1658,10 @@
          <entry>number of unread messages</entry>
         </row>
         <row>
+ <entry>Deleted</entry>
+ <entry>number of deleted messages</entry>
+ </row>
+ <row>
          <entry>Size</entry>
          <entry>mailbox size</entry>
         </row>
@@ -1668,6 +1669,36 @@
       </tgroup>
      </table>
     </para>
+ <para>
+ <example>
+ <title><function>imap_mailboxmsginfo</function> example</title>
+ <programlisting role="php">
+&lt;?php
+
+$mbox = imap_open("{your.imap.host}INBOX","username", "password")
+ || die("can't connect: ".imap_last_error());
+
+$check = imap_mailboxmsginfo($mbox);
+
+if($check) {
+ print "Date: " . $check->Date ."&lt;br>\n" ;
+ print "Driver: " . $check->Driver ."&lt;br>\n" ;
+ print "Mailbox: " . $check->Mailbox ."&lt;br>\n" ;
+ print "Messages: ". $check->Nmsgs ."&lt;br>\n" ;
+ print "Recent: " . $check->Recent ."&lt;br>\n" ;
+ print "Unread: " . $check->Unread ."&lt;br>\n" ;
+ print "Deleted: " . $check->Deleted ."&lt;br>\n" ;
+ print "Size: " . $check->Size ."&lt;br>\n" ;
+} else {
+ print "imap_check() failed: ".imap_lasterror(). "&lt;br>\n";
+}
+
+imap_close($mbox);
+
+?&gt;
+ </programlisting>
+ </example>
+ </para>
    </refsect1>
   </refentry>
 
@@ -1693,7 +1724,7 @@
     </funcsynopsis>
     <para>
      Returns a properly formatted email address as defined in
- <ulink url="&url.rfc;/rfc822.html">RFC822</ulink>
+ <ulink url="&url.rfc;rfc822.html">RFC822</ulink>
      given the mailbox, host, and personal info.
     </para>
     <para>
@@ -1725,7 +1756,7 @@
     </funcsynopsis>
     <para>
      This function parses the address string as defined in
- <ulink url="&url.rfc;/rfc822.html">RFC822</ulink> and
+ <ulink url="&url.rfc;rfc822.html">RFC822</ulink> and
      for each address, returns an array of objects.
      The objects properties are:
     </para>
@@ -1872,7 +1903,7 @@
     <title>Description</title>
     <funcsynopsis>
      <funcprototype>
- <funcdef>string <function>imap_sort</function></funcdef>
+ <funcdef>array <function>imap_sort</function></funcdef>
       <paramdef>int <parameter>stream</parameter></paramdef>
       <paramdef>int <parameter>criteria</parameter></paramdef>
       <paramdef>int <parameter>reverse</parameter></paramdef>
@@ -1929,7 +1960,7 @@
     </funcsynopsis>
     <para>
      This function causes a fetch of the complete, unfiltered
- <ulink url="&url.rfc;/rfc822.html">RFC822</ulink>
+ <ulink url="&url.rfc;rfc822.html">RFC822</ulink>
      format header of the specified message as a text string and
      returns that text string.
     </para>
@@ -2358,9 +2389,9 @@
      not valid modified UTF-7. This function is needed to decode
      mailbox names that contain international characters outside of
      the printable ASCII range. The modified UTF-7 encoding is defined
- in <ulink url="&url.rfc;/rfc2060.html">RFC 2060</ulink>, section
+ in <ulink url="&url.rfc;rfc2060.html">RFC 2060</ulink>, section
      5.1.3 (original UTF-7 was defned in <ulink
- url="&url.rfc;/rfc1642.html">RFC1642</ulink>).
+ url="&url.rfc;rfc1642.html">RFC1642</ulink>).
     </para>
    </refsect1>
   </refentry>
@@ -2385,9 +2416,9 @@
      text. This is needed to encode mailbox names that contain
      international characters outside of the printable ASCII
      range. The modified UTF-7 encoding is defined in <ulink
- url="&url.rfc;/rfc2060.html">RFC 2060</ulink>, section 5.1.3
+ url="&url.rfc;rfc2060.html">RFC 2060</ulink>, section 5.1.3
      (original UTF-7 was defned in <ulink
- url="&url.rfc;/rfc1642.html">RFC1642</ulink>).
+ url="&url.rfc;rfc1642.html">RFC1642</ulink>).
     </para>
     <para>
      Returns the modified UTF-7 text.
@@ -2413,7 +2444,7 @@
     <para>
      Converts the given <parameter>text</parameter> to
      UTF8 (as defined in
- <ulink url="&url.rfc;/rfc2044.html">RFC2044</ulink>).
+ <ulink url="&url.rfc;rfc2044.html">RFC2044</ulink>).
     </para>
    </refsect1>
   </refentry>
@@ -2541,6 +2572,52 @@
    </refsect1>
   </refentry>
 
+ <refentry id="function.imap-mime-header-decode">
+ <refnamediv>
+ <refname>imap_mime_header_decode</refname>
+ <refpurpose>Decode MIME header elements</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>imap_header_decode</function></funcdef>
+ <paramdef>string <parameter>text</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>imap_mime_header_decode</function> function decodes
+ MIME message header extensions that are non ASCII text
+ (see <ulink url="&url.rfc;rfc2047.html">RFC2047</ulink>)
+ The decoded elements are returned in an array of objects,
+ where each object has two properties, "charset" &amp; "text".
+ If the element hasn't been encoded, and in other words is in
+ plain US-ASCII,the "charset" property of that element is set to
+ "default".
+ </para>
+ <para>
+ <example>
+ <title><function>imap_mime_header_decode</function> example</title>
+ <programlisting role="php">
+$text="=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= &lt;keld <email protected>>";
+
+$elements=imap_mime_header_decode($text);
+for($i=0;$i&lt;count($elements);$i++) {
+ echo "Charset: {$elements[$i]->charset}\n";
+ echo "Text: {$elements[$i]->text}\n\n";
+}
+
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ In the above example we would have two elements, whereas the first
+ element had previously been encoded with ISO-8859-1, and the second
+ element would be plain US-ASCII.
+ </para>
+ </refsect1>
+ </refentry>
+
   <refentry id="function.imap-mail-compose">
    <refnamediv>
     <refname>imap_mail_compose</refname>
@@ -2558,6 +2635,45 @@
      </funcprototype>
     </funcsynopsis>
     <para>
+ </para>
+ <para>
+ <example>
+ <title><function>imap_mail_compose</function> example</title>
+ <programlisting role="php">
+&lt;?php
+
+$envelope["from"]="musone <email protected>";
+$envelope["to"]="musone <email protected>";
+$envelope["cc"]="musone <email protected>";
+
+$part1["type"]=TYPEMULTIPART;
+$part1["subtype"]="mixed";
+
+$filename="/tmp/imap.c.gz";
+$fp=fopen($filename,"r");
+$contents=fread($fp,filesize($filename));
+fclose($fp);
+
+$part2["type"]=TYPEAPPLICATION;
+$part2["encoding"]=ENCBINARY;
+$part2["subtype"]="octet-stream";
+$part2["description"]=basename($filename);
+$part2["contents.data"]=$contents;
+
+$part3["type"]=TYPETEXT;
+$part3["subtype"]="plain";
+$part3["description"]="description3";
+$part3["contents.data"]="contents.data3\n\n\n\t";
+
+$body[1]=$part1;
+$body[2]=$part2;
+$body[3]=$part3;
+
+echo nl2br(imap_mail_compose($envelope,$body));
+
+?&gt;
+ </programlisting>
+ </example>
     </para>
    </refsect1>
   </refentry>