Share this page

# imap_append

Internet Messaging Functions (IMAP)

Appends a message to the end of a mailbox.

    int imap_append( char *transaction, char *message, char *flag, char *mailbox, ENDITEM, LAST );

transaction | A transaction name for this step in quotes. To avoid creating a transaction for this step, use a null string, "".
message | The message string or the name of the file containing the message. When specifying a file, use the following format: "MessageFile=file_name".
flag | Flags to apply to the appended message in the following format: `"Flags=`flag1, flag2, ...`"`
mailbox | The name of the destination mailbox in the following format: `"MAILBOX=`mailbox_name`"`
ENDITEM | A marker indicating the end of the data item list. Repeat the message, flag, mailbox, and ENDITEM arguments for each set of data that you fetch.
LAST | A marker indicating the end of the argument list.

The imap_append function appends a literal expression as a new message to the end of the specified mailbox.

This function is for use with global sessions. For multiple sessions, use the imap_append_ex function, which allows you to specify a session identifier.

## Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.

## Parameterization

All arguments of this function of the type char, can be parameterized with standard parameterization.

## Example

In the following example, the imap_append function appends the contents the file mynote.dat as a mail message to the Sent Mail mailbox, and marks it as read (\Seen).

        imap_append("AddToSentMail",
                "MessageFile=mynote1.dat",
                "Mailbox=Sent Mail",
                "Flags=\Seen",
                ENDITEM,
                LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: