Sample code for 30+ languages & platforms
PureBasic

Transition from MailMan.GetPop3SslServerCert to MailMan.GetServerCert

Provides instructions for replacing deprecated GetPop3SslServerCert method calls with GetServerCert.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkMailMan.pb"
IncludeFile "CkCert.pb"

Procedure ChilkatExample()

    success.i = 0

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

    ; ...
    ; ...

    ; ------------------------------------------------------------------------
    ; The GetPop3SslServerCert method is deprecated:

    certObj.i = CkMailMan::ckGetPop3SslServerCert(mailman)
    If CkMailMan::ckLastMethodSuccess(mailman) = 0
        Debug CkMailMan::ckLastErrorText(mailman)
        CkMailMan::ckDispose(mailman)
        ProcedureReturn
    EndIf

    ; ...
    ; ...

    CkCert::ckDispose(certObj)

    ; ------------------------------------------------------------------------
    ; Do the equivalent using GetServerCert.
    ; Your application creates a new, empty Cert object which is passed 
    ; in the last argument and filled upon success.

    ; We want the POP3 email server certificate..
    useSmtp.i = 0

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

    success = CkMailMan::ckGetServerCert(mailman,useSmtp,certOut)
    If success = 0
        Debug CkMailMan::ckLastErrorText(mailman)
        CkMailMan::ckDispose(mailman)
        CkCert::ckDispose(certOut)
        ProcedureReturn
    EndIf



    CkMailMan::ckDispose(mailman)
    CkCert::ckDispose(certOut)


    ProcedureReturn
EndProcedure