VBScript
VBScript
Transition from Imap.GetSslServerCert to Imap.GetServerCert
Provides instructions for replacing deprecated GetSslServerCert method calls with GetServerCert.Chilkat VBScript Downloads
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
success = 0
set imap = CreateObject("Chilkat.Imap")
' ...
' ...
' ------------------------------------------------------------------------
' The GetSslServerCert method is deprecated:
' certObj is a Chilkat.Cert
Set certObj = imap.GetSslServerCert()
If (imap.LastMethodSuccess = 0) Then
outFile.WriteLine(imap.LastErrorText)
WScript.Quit
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using GetServerCert.
' Your application creates a new, empty Cert object which is passed
' in the last argument and filled upon success.
set cert = CreateObject("Chilkat.Cert")
success = imap.GetServerCert(cert)
If (success = 0) Then
outFile.WriteLine(imap.LastErrorText)
WScript.Quit
End If
outFile.Close