php-doc-en/reference/imap/functions/imap-append.xml
2006-01-23 01:48:07 +00:00

84 lines
2.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 -->
<refentry id="function.imap-append">
<refnamediv>
<refname>imap_append</refname>
<refpurpose>
Append a string message to a specified mailbox
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>imap_append</methodname>
<methodparam><type>resource</type><parameter>imap_stream</parameter></methodparam>
<methodparam><type>string</type><parameter>mbox</parameter></methodparam>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
<function>imap_append</function> appends a string message to the
specified mailbox <parameter>mbox</parameter>. If the optional
<parameter>options</parameter> is specified, writes the
<parameter>options</parameter> to that mailbox also.
</para>
<para>
&return.success;
</para>
<para>
When talking to the Cyrus IMAP server, you must use "\r\n" as
your end-of-line terminator instead of "\n" or the operation will
fail.
</para>
<para>
<example>
<title><function>imap_append</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$stream = imap_open("{imap.example.org}INBOX.Drafts", "username", "password");
$check = imap_check($stream);
echo "Msg Count before append: ". $check->Nmsgs . "\n";
imap_append($stream, "{imap.example.org}INBOX.Drafts"
, "From: me@example.com\r\n"
. "To: you@example.com\r\n"
. "Subject: test\r\n"
. "\r\n"
. "this is a test message, please ignore\r\n"
);
$check = imap_check($stream);
echo "Msg Count after append : ". $check->Nmsgs . "\n";
imap_close($stream);
?>
]]>
</programlisting>
</example>
</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:"../../../../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
-->