PowerBuilder
PowerBuilder
Verify POP3 Login (Connect and Authenticate)
See more POP3 Examples
Demonstrates the Chilkat MailMan.VerifyPopLogin method, which tests whether Chilkat can connect to the configured POP3 server and successfully log in using the current POP3 authentication settings. This example configures the POP3 host and credentials and verifies login.
Background: POP3 login is the
USER/PASS (or APOP/SASL) exchange that follows connecting. VerifyPopLogin performs the full round trip — connect, TLS, and authenticate — making it the go-to preflight check for validating a mailbox's credentials. A false result after VerifyPopConnection succeeds isolates the problem to the username or password.Chilkat PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Mailman
integer li_LoggedIn
li_Success = 0
// Demonstrates the MailMan.VerifyPopLogin method, which tests whether Chilkat can connect to
// the configured POP3 server and successfully log in using the current POP3 authentication
// settings.
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"
// Test both connectivity and login.
li_LoggedIn = loo_Mailman.VerifyPopLogin()
if li_LoggedIn = 1 then
Write-Debug "Successfully connected and logged in to the POP3 server."
else
Write-Debug "POP3 connect or login failed."
end if
destroy loo_Mailman