Sample code for 30+ languages & platforms
PureBasic

Verify Connectivity to the POP3 Server

See more POP3 Examples

Demonstrates the Chilkat MailMan.VerifyPopConnection method, which tests whether a TCP/IP connection can be established with the configured POP3 server. It verifies connectivity only — it does not authenticate. This example configures the POP3 host and checks whether it can be reached.

Background: This is the POP3 counterpart to VerifySmtpConnection. It answers the first diagnostic question — can the client reach the POP3 server on the configured host and port and complete the TLS handshake? A failure here indicates a network, firewall, DNS, port, or certificate problem rather than a credentials issue, which VerifyPopLogin checks next.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkMailMan.pb"

Procedure ChilkatExample()

    ;  Demonstrates the MailMan.VerifyPopConnection method, which tests whether a TCP/IP
    ;  connection can be established with the configured POP3 server.  It verifies connectivity
    ;  only (it does not authenticate).

    mailman.i = CkMailMan::ckCreate()
    If mailman.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ;  Configure the POP3 server connection.
    CkMailMan::setCkMailHost(mailman, "pop.example.com")
    CkMailMan::setCkMailPort(mailman, 995)
    CkMailMan::setCkPopSsl(mailman, 1)

    ;  Test connectivity to the POP3 server.
    connected.i = CkMailMan::ckVerifyPopConnection(mailman)

    If connected = 1
        Debug "Successfully connected to the POP3 server."
    Else
        Debug "Could not connect to the POP3 server."
    EndIf



    CkMailMan::ckDispose(mailman)


    ProcedureReturn
EndProcedure