imap_store

Internet Messaging Functions (IMAP)

Alters messages in a mailbox.

int imap_store( char *transaction, char *method, char *message, char *action, ENDITEM, LAST );
transactionA transaction name for this step in quotes. To avoid creating a transaction for this step, use a null string, "".
methodThe store method: Silent
messageThe message number or range of messages to delete. This only applies for the DeleteSpecificMail method. Use the following format:
"Message=message_number | begin:end "
actionThe action to perform on the message(s):
Flag - Replace existing flags with the following flag(s).
AddFlag - Add another flag to the existing flag(s).
RemFlag - Remove the specified flag(s).
ENDITEM A marker indicating the end of the message items. Repeat the message, action and ENDITEM arguments for each set of messages you need to alter.
LAST A marker indicating the end of the argument list.

The imap_store function changes the flags associated with specific messages in the current mailbox. You can change all the flags, add on to the existing flags, or remove flags.

This function is for use with global sessions. For multiple sessions, use the imap_store_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_store function sets flags for specific messages. Message 1 is marked as deleted and seen. Messages 5 through 10 are marked as deleted, and the Seen flag is removed from message 9.

    imap_store("UpdateMessages",
        "Mode=SILENT",
        "Message=1", "Flags=\Deleted \Seen", ENDITEM,
        "Message=5:10", "AddFlags=\Deleted", ENDITEM,
        "Message=9", "RemFlags=\Seen", ENDITEM,
        LAST );