PowerBuilder
PowerBuilder
Authenticate with the POP3 Server
See more POP3 Examples
Demonstrates the Chilkat MailMan.Pop3Authenticate method, which authenticates with the POP3 server using the current POP3 property settings, such as PopUsername and PopPassword. It is typically called after Pop3Connect. This example connects and then authenticates.
Background: POP3 authentication is the step, after connecting, where the client identifies itself — classically with the
USER and PASS commands, or a more secure mechanism. Calling Pop3Connect and Pop3Authenticate as distinct steps lets you determine precisely which phase fails, and lets you hold an authenticated session open to perform several mailbox operations before ending it with Pop3EndSession.Chilkat PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Mailman
li_Success = 0
// Demonstrates the MailMan.Pop3Authenticate method, which authenticates with the POP3 server
// using the current POP3 property settings (such as PopUsername and PopPassword). It is
// typically called after Pop3Connect.
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
// Configure the POP3 server connection.
loo_Mailman.MailHost = "pop.example.com"
loo_Mailman.MailPort = 995
loo_Mailman.PopSsl = 1
loo_Mailman.PopUsername = "user@example.com"
loo_Mailman.PopPassword = "myPassword"
// Connect first, then authenticate.
li_Success = loo_Mailman.Pop3Connect()
if li_Success = 0 then
Write-Debug loo_Mailman.LastErrorText
destroy loo_Mailman
return
end if
li_Success = loo_Mailman.Pop3Authenticate()
if li_Success = 0 then
Write-Debug loo_Mailman.LastErrorText
destroy loo_Mailman
return
end if
Write-Debug "Authenticated with the POP3 server."
destroy loo_Mailman