PureBasic
PureBasic
Transition from MailMan.GetSmtpSslServerCert to MailMan.GetServerCert
Provides instructions for replacing deprecated GetSmtpSslServerCert method calls with GetServerCert.Chilkat PureBasic Downloads
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 GetSmtpSslServerCert method is deprecated:
certObj.i = CkMailMan::ckGetSmtpSslServerCert(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 SMTP email server certificate..
useSmtp.i = 1
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