(C#) Transition from MailMan.GetSmtpSslServerCert to MailMan.GetServerCert
Provides instructions for replacing deprecated GetSmtpSslServerCert method calls with GetServerCert. Note: This example requires Chilkat v11.0.0 or greater.
Chilkat.MailMan mailman = new Chilkat.MailMan();
// ...
// ...
// ------------------------------------------------------------------------
// The GetSmtpSslServerCert method is deprecated:
Chilkat.Cert certObj = mailman.GetSmtpSslServerCert();
if (mailman.LastMethodSuccess == false) {
Debug.WriteLine(mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// 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..
bool useSmtp = true;
Chilkat.Cert certOut = new Chilkat.Cert();
bool success = mailman.GetServerCert(useSmtp,certOut);
if (success == false) {
Debug.WriteLine(mailman.LastErrorText);
return;
}
|