(PureBasic) Retrieve UIDL's from POP3 Server
Retrieve a list of UIDLs from a POP3 server. A UIDL is an identifier consisting of 1 to 70 characters in the range 0x21 to 0x7E, which uniquely identifies a messages within a mailbox and persists across sessions.
IncludeFile "CkMailMan.pb"
IncludeFile "CkStringArray.pb"
Procedure ChilkatExample()
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
mailman.i = CkMailMan::ckCreate()
If mailman.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkMailMan::setCkMailHost(mailman, "pop.example.com")
CkMailMan::setCkPopUsername(mailman, "myLogin")
CkMailMan::setCkPopPassword(mailman, "myPassword")
CkMailMan::setCkMailPort(mailman, 995)
CkMailMan::setCkPopSsl(mailman, 1)
sa.i = CkMailMan::ckGetUidls(mailman)
If CkMailMan::ckLastMethodSuccess(mailman) = 0
Debug CkMailMan::ckLastErrorText(mailman)
CkMailMan::ckDispose(mailman)
ProcedureReturn
EndIf
; Download each email by UIDL.
uidl.s
i.i = 0
numUidls.i = CkStringArray::ckCount(sa)
While i < numUidls
uidl = CkStringArray::ckGetString(sa,i)
Debug uidl
i = i + 1
Wend
CkStringArray::ckDispose(sa)
CkMailMan::ckDispose(mailman)
ProcedureReturn
EndProcedure
|