Sample code for 30+ languages & platforms
Visual FoxPro

Transition from MailMan.GetSmtpSslServerCert to MailMan.GetServerCert

Provides instructions for replacing deprecated GetSmtpSslServerCert method calls with GetServerCert.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loMailman
LOCAL loCertObj
LOCAL lnUseSmtp
LOCAL loCertOut

lnSuccess = 0

loMailman = CreateObject('Chilkat.MailMan')

* ...
* ...

* ------------------------------------------------------------------------
* The GetSmtpSslServerCert method is deprecated:

loCertObj = loMailman.GetSmtpSslServerCert()
IF (loMailman.LastMethodSuccess = 0) THEN
    ? loMailman.LastErrorText
    RELEASE loMailman
    CANCEL
ENDIF

* ...
* ...

RELEASE loCertObj

* ------------------------------------------------------------------------
* 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..
lnUseSmtp = 1

loCertOut = CreateObject('Chilkat.Cert')
lnSuccess = loMailman.GetServerCert(lnUseSmtp,loCertOut)
IF (lnSuccess = 0) THEN
    ? loMailman.LastErrorText
    RELEASE loMailman
    RELEASE loCertOut
    CANCEL
ENDIF

RELEASE loMailman
RELEASE loCertOut