Sample code for 30+ languages & platforms
DataFlex

Read a POP3 Mailbox

Read a POP3 mailbox and display the FROM and SUBJECT header fields of each email.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoMailman
    Integer iNumMessages

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    // The mailman object is used for receiving (POP3) 
    // and sending (SMTP) email.
    Get Create (RefClass(cComChilkatMailMan)) To hoMailman
    If (Not(IsComObjectCreated(hoMailman))) Begin
        Send CreateComObject of hoMailman
    End

    // Set the POP3 server's hostname
    Set ComMailHost Of hoMailman To "pop.example.com"

    // Set the POP3 login/password.
    Set ComPopUsername Of hoMailman To "myLogin"
    Set ComPopPassword Of hoMailman To "myPassword"

    // Get the number of messages in the mailbox.
    Get ComGetMailboxCount Of hoMailman To iNumMessages
    Showln iNumMessages


End_Procedure