(Go) 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.
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
mailman := chilkat.NewMailMan()
mailman.SetMailHost("pop.example.com")
mailman.SetPopUsername("myLogin")
mailman.SetPopPassword("myPassword")
mailman.SetMailPort(995)
mailman.SetPopSsl(true)
sa := mailman.GetUidls()
if mailman.LastMethodSuccess() == false {
fmt.Println(mailman.LastErrorText())
mailman.DisposeMailMan()
return
}
// Download each email by UIDL.
var uidl *string = new(string)
i := 0
numUidls := sa.Count()
for i < numUidls {
uidl = *sa.GetString(i)
fmt.Println(*uidl)
i = i + 1
}
sa.DisposeStringArray()
mailman.DisposeMailMan()
|