(Lianja) POP3 Fetch a Single Email by UIDL
Demonstrates how to fetch a single email by UIDL.
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loMailman = createobject("CkMailMan")
loMailman.MailHost = "pop.example.com"
loMailman.PopUsername = "myLogin"
loMailman.PopPassword = "myPassword"
loMailman.MailPort = 995
loMailman.PopSsl = .T.
loSa = loMailman.GetUidls()
if (loMailman.LastMethodSuccess = .F.) then
? loMailman.LastErrorText
release loMailman
return
endif
// Download each email by UIDL.
i = 0
lnNumUidls = loSa.Count
do while i < lnNumUidls
lcUidl = loSa.GetString(i)
? lcUidl
loEmail = loMailman.FetchEmail(lcUidl)
if (loMailman.LastMethodSuccess = .F.) then
? loMailman.LastErrorText
release loMailman
return
endif
? loEmail.Subject
? ""
release loEmail
i = i + 1
enddo
release loSa
release loMailman
|