Example: pop3_retrieve

In the following example, the pop3_retrieve function retrieves the first five messages.

...
// 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 get count
totalMessages = pop3_list("","POP3", LAST );
/* Output the count (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 the 1st and 5th messages on the server without deleting them.
Create parameters for headers */
pop3_retrieve("POP3", 
    "RetrieveList=1,5", 
    "DeleteMail=no", 
    "CreateParamForHeader=From,To,Date,Content-Type,Attachment", 
    LAST );
// Delete the first and third messages on the server
pop3_delete("POP3", "DeleteList=1,3", LAST );
// Logoff
pop3_logoff();