Sample code for 30+ languages & platforms
Swift

Transition from MailMan.GetPop3SslServerCert to MailMan.GetServerCert

Provides instructions for replacing deprecated GetPop3SslServerCert method calls with GetServerCert.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let mailman = CkoMailMan()!

    // ...
    // ...

    // ------------------------------------------------------------------------
    // The GetPop3SslServerCert method is deprecated:

    var certObj: CkoCert? = mailman.getPop3SslServerCert()
    if mailman.lastMethodSuccess == false {
        print("\(mailman.lastErrorText!)")
        return
    }

    // ...
    // ...

    certObj = nil

    // ------------------------------------------------------------------------
    // 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..
    var useSmtp: Bool = false

    let certOut = CkoCert()!
    success = mailman.getServerCert(useSmtp: useSmtp, cert: certOut)
    if success == false {
        print("\(mailman.lastErrorText!)")
        return
    }


}