Share this page

# pop3_list

Post Office Protocol Vuser Functions (POP3)

Lists the messages on the POP3 server.

    long pop3_list( char *transaction, [char *save_to_param,] 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, "".
save_to_param | Saves the data returned by the server to a parameter. Use the format: "SaveTo=ParameterName" This parameter is optional
LAST | A marker indicating the end of the argument list.

The pop3_list function lists the messages on the POP3 server. It returns the total number of messages that are available on the server.

This function is for use with global sessions. For multiple sessions, use the pop3_list_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

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, the pop3_list function gets a list of the messages and saves the message count to a variable.

    ...

    // Logon to the POP3 server

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

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

    totalMessages = pop3_list("ListParam","List_Messages", LAST );

    // Display the received value (It is also displayed by the pop3_list 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("POP3", "RetrieveList=ALL", "DeleteMail=false", LAST );

    // Logoff

    pop3_logoff();

    ...

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: