Sample code for 30+ languages & platforms
SQL Server

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 SQL Server Downloads

SQL Server
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    --  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).

    DECLARE @mailman int
    EXEC @hr = sp_OACreate 'Chilkat.MailMan', @mailman OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    --  Configure the POP3 server connection.
    EXEC sp_OASetProperty @mailman, 'MailHost', 'pop.example.com'
    EXEC sp_OASetProperty @mailman, 'MailPort', 995
    EXEC sp_OASetProperty @mailman, 'PopSsl', 1

    --  Test connectivity to the POP3 server.
    DECLARE @connected int
    EXEC sp_OAMethod @mailman, 'VerifyPopConnection', @connected OUT

    IF @connected = 1
      BEGIN

        PRINT 'Successfully connected to the POP3 server.'
      END
    ELSE
      BEGIN

        PRINT 'Could not connect to the POP3 server.'
      END

    EXEC @hr = sp_OADestroy @mailman


END
GO