IMAP_APPEND(3) 1 IMAP_APPEND(3)
imap_append - Append a string message to a specified mailbox
SYNOPSIS
bool imap_append NULL NULL (resource $imap_stream, string $mailbox, string $message, [string $options], [string $internal_date])
DESCRIPTION
Appends a string $message to the specified $mailbox.
PARAMETERS
o $
imap_stream -An IMAP stream returned by imap_open(3).
o $mailbox
- The mailbox name, see imap_open(3) for more information
o $message
- The message to be append, as a string When talking to the Cyrus IMAP server, you must use "
" as your end-of-line terminator
instead of "
" or the operation will fail
o $options
- If provided, the $options will also be written to the $mailbox
o $internal_date
- If this parameter is set, it will set the INTERNALDATE on the appended message. The parameter should be a date string that con-
forms to the rfc2060 specifications for a date_time value.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------+
| 5.3.2 | |
| | |
| | Added INTERNALDATE support to imap_append. |
| | |
+--------+---------------------------------------------+
EXAMPLES
Example #1
imap_append(3) example
<?php
$stream = imap_open("{imap.example.org}INBOX.Drafts", "username", "password");
$check = imap_check($stream);
echo "Msg Count before append: ". $check->Nmsgs . "
";
imap_append($stream, "{imap.example.org}INBOX.Drafts"
, "From: me@example.com
"
. "To: you@example.com
"
. "Subject: test
"
. "
"
. "this is a test message, please ignore
"
);
$check = imap_check($stream);
echo "Msg Count after append : ". $check->Nmsgs . "
";
imap_close($stream);
?>
PHP Documentation Group IMAP_APPEND(3)