Share this page

# pop3_delete_ex

Post Office Protocol Vuser Functions (POP3)

Deletes messages on the POP3 server for a specific session.

    long pop3_delete_ex( POP3 *pppop3, char *transaction, char *deleteList, LAST );

pppop3 | A session identifier.
transaction | A transaction name for this step in quotes. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
deleteList | The messages to delete. Use the following format: `"DeleteList=`message1`,`message2,mesage3...`" where each message is a 1-based index of the message in the list.` To delete all messages, use `"DeleteList=All"`
LAST | A marker indicating the end of the argument list.

The pop3_delete_ex function deletes messages on the POP3 server for a specific session.

This function is for use with multiple sessions. For global sessions, use the pop3_delete function, which leaves out the session identifier.

## Return Values

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

## Parameterization

The following argument(s) can be parameterized with standard parameterization: deleteList

## Example

In the following example, the pop3_delete_ex function deletes the first and third messages.

    ...

    // Logon to the POP3 server

    pop3_logon_ex(&pppop3, "Login", "
            URL=pop3://user0004t:my_pwd@techno.merc-int.com",
            LAST );

    // List all messages on the server and receive that value

    totalMessages = pop3_list_ex(&pppop3, "POP3", LAST );

    // Display the received value (It is also displayed by the pop3_list_ex function)

    lr_log_message("There are %d total messages on the server.\r\n\r\n", totalMessages);

    // Retrieve all messages on the server without deleting any of them

    pop3_retrieve_ex(&pppop3, "POP3", "RetrieveList=ALL", "DeleteMail=false", LAST );

    // Delete the 1st, 2nd and 3rd messages on the server

    pop3_delete_ex(&pppop3, "POP3", "DeleteMail=1,2,3", LAST );

    // Logoff

    pop3_logoff_ex(&pppop3);

    return 0;

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: