Sample code for 30+ languages & platforms
PureBasic

Example: MailMan.FetchAll method

Demonstrates how to call the FetchAll method.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkEmailBundle.pb"
IncludeFile "CkMailMan.pb"

Procedure ChilkatExample()

    success.i = 0

    success = 0
    mailman.i = CkMailMan::ckCreate()
    If mailman.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; Setup mailman with POP3 server and login settings...
    ; ...
    ; ...

    bundle.i = CkEmailBundle::ckCreate()
    If bundle.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    keepOnServer.i = 1
    headersOnly.i = 0
    ; numBodyLines only applies if downloading headers-only.
    numBodyLines.i = 0

    success = CkMailMan::ckFetchAll(mailman,keepOnServer,headersOnly,numBodyLines,bundle)
    If success = 0
        Debug CkMailMan::ckLastErrorText(mailman)
        CkMailMan::ckDispose(mailman)
        CkEmailBundle::ckDispose(bundle)
        ProcedureReturn
    EndIf

    ; ...
    ; ...


    CkMailMan::ckDispose(mailman)
    CkEmailBundle::ckDispose(bundle)


    ProcedureReturn
EndProcedure