Share this page

# imap_store

Internet Messaging Functions (IMAP)

Alters messages in a mailbox.

    int imap_store( char *transaction, char *method, char *message, char *action, ENDITEM, LAST );

transaction | A transaction name for this step in quotes. To avoid creating a transaction for this step, use a null string, "".
method | The store method: `Silent`
message | The message number or range of messages to delete. This only applies for the DeleteSpecificMail method. Use the following format: `"Message=`message_number | begin`:`end `"`
action | The 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.

Copy code

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

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