Go
Go
Get POP3 Mailbox Info as XML
See more POP3 Examples
Demonstrates the Chilkat MailMan.GetMailboxInfoXml method, which returns an XML document describing the messages currently in the POP3 mailbox — including each message's UIDL and size in bytes. This example configures the POP3 connection and prints the listing.
Tip: XML parsing code for this result can be generated at Chilkat Tools.
Background: Before downloading, it is often useful to survey what's in the mailbox. This method combines POP3's
UIDL listing (a stable unique ID per message) with LIST sizes into one XML result. With it you can decide which messages to fetch or delete by UIDL — for example skipping ones already processed, or targeting only messages above a certain size.Chilkat Go Downloads
// Demonstrates the MailMan.GetMailboxInfoXml method, which returns an XML document with
// information about the messages currently in the POP3 mailbox, including the UIDL and size
// (in bytes) of each message.
mailman := chilkat.NewMailMan()
// Configure the POP3 server connection.
mailman.SetMailHost("pop.example.com")
mailman.SetMailPort(995)
mailman.SetPopSsl(true)
mailman.SetPopUsername("user@example.com")
mailman.SetPopPassword("myPassword")
// Retrieve the mailbox listing as XML.
xmlInfo := mailman.GetMailboxInfoXml()
fmt.Println(*xmlInfo)
// The returned XML looks similar to:
//
// <mailbox count="2" size="4786">
// <email uidl="UID22-1784216315" msgNum="1" size="2394" />
// <email uidl="UID23-1784216315" msgNum="2" size="2392" />
// </mailbox>
//
// XML parsing code for this result can be generated at Chilkat's online tool:
// https://tools.chilkat.io/xmlParse
// Note: Explicitly connecting/authenticating is optional. Chilkat MailMan automatically
// connects and authenticates -- using the property settings above -- whenever a server
// operation requires it. Calling the explicit connect/authenticate methods can still be
// helpful to determine whether a failure occurs while connecting or while authenticating.
mailman.DisposeMailMan()