(Swift) 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.
func chilkatTest() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let mailman = CkoMailMan()!
mailman.mailHost = "pop.example.com"
mailman.popUsername = "myLogin"
mailman.popPassword = "myPassword"
mailman.mailPort = 995
mailman.popSsl = true
var sa: CkoStringArray? = mailman.getUidls()
if mailman.lastMethodSuccess == false {
print("\(mailman.lastErrorText!)")
return
}
// Download each email by UIDL.
var uidl: String?
var i: Int = 0
var numUidls: Int = sa!.count.intValue
while i < numUidls {
uidl = sa!.getString(i)
print("\(uidl!)")
i = i + 1
}
sa = nil
}
|