Sample code for 30+ languages & platforms
Xojo Plugin

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 Xojo Plugin Downloads

Xojo Plugin
//  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.

Dim mailman As New Chilkat.MailMan

//  Configure the POP3 server connection.
mailman.MailHost = "pop.example.com"
mailman.MailPort = 995
mailman.PopSsl = True
mailman.PopUsername = "user@example.com"
mailman.PopPassword = "myPassword"

//  Retrieve the mailbox listing as XML.
Dim xmlInfo As String
xmlInfo = mailman.GetMailboxInfoXml()
System.DebugLog(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.