array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.imap-append.php', 1 => 'imap_append', ), 'up' => array ( 0 => 'ref.imap.php', 1 => 'IMAP Funciones', ), 'prev' => array ( 0 => 'function.imap-alerts.php', 1 => 'imap_alerts', ), 'next' => array ( 0 => 'function.imap-base64.php', 1 => 'imap_base64', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imap/functions/imap-append.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
imap_append — Append a string message to a specified mailbox
$imap
,$folder
,$message
,$options
= null
,$internal_date
= null
Appends a string message
to the specified folder
.
imap
An IMAP\Connection instance.
folder
The mailbox name, see imap_open() for more information
El paso de datos no confiables a este parámetro es inseguro, a menos que imap.enable_insecure_rsh esté inhabilitado.
message
The message to be append, as a string
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
options
If provided, the options
will also be written
to the folder
internal_date
If this parameter is set, it will set the INTERNALDATE on the appended message. The parameter should be a date string that conforms to the rfc2060 specifications for a date_time value.
Versión | Descripción |
---|---|
8.1.0 |
The imap parameter expects an IMAP\Connection
instance now; previously, a valid imap recurso was expected.
|
8.0.0 |
options and internal_date are now nullable.
|
Ejemplo #1 imap_append() example
<?php
$imap = imap_open("{imap.example.org}INBOX.Drafts", "username", "password");
$check = imap_check($imap);
echo "Msg Count before append: ". $check->Nmsgs . "\n";
imap_append($imap, "{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($imap);
echo "Msg Count after append : ". $check->Nmsgs . "\n";
imap_close($imap);
?>