Share this page

# mapi_delete_mail

MS Exchange Server Functions (mapi)

Deletes the current or selected e-mail entries.

    int mapi_delete_mail( char *transaction, [char *ID,] LAST );

transaction | A transaction name for this step in quotes. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
ID | The ID of messages to delete. Use the following format: `"Id=`number`"`
LAST | A marker indicating the end of the argument list.

The mapi_delete_mail function deletes the current or selected e-mail entries on the MS Exchange server.

This function is for use with global sessions. For multiple sessions, use the mapi_delete_mail_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 examples, the mapi_delete_mail function deletes all or selected messages.

    // Delete all mail.

        mapi_delete_mail("DeleteMail", LAST );

    // Get the Message identifier of current email message.

    char *msgid = mapi_get_property_sz(&mapi,"Message ID");

    // Delete mail w/ Message Id=XYZ & ABC

        mapi_delete_mail("DeleteMail",
                    "Id=ABC",
                    "Id=XYZ",
                    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: