Sample code for 30+ languages & platforms
PowerBuilder

Number of Messages in a POP3 Mailbox

Get the number of messages in a POP3 mailbox.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_Mailman
integer li_NumMessages

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

// The mailman object is used for receiving (POP3) 
// and sending (SMTP) email.
loo_Mailman = create oleobject
li_rc = loo_Mailman.ConnectToNewObject("Chilkat.MailMan")
if li_rc < 0 then
    destroy loo_Mailman
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Set the POP3 server's hostname
loo_Mailman.MailHost = "pop.example.com"

// Set the POP3 login/password.
loo_Mailman.PopUsername = "myLogin"
loo_Mailman.PopPassword = "****"

// Get the number of messages in the mailbox.
li_NumMessages = loo_Mailman.GetMailboxCount()
Write-Debug string(li_NumMessages)


destroy loo_Mailman