Java
Java
Transition from MailMan.GetPop3SslServerCert to MailMan.GetServerCert
Provides instructions for replacing deprecated GetPop3SslServerCert method calls with GetServerCert.Chilkat Java Downloads
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
boolean success = false;
CkMailMan mailman = new CkMailMan();
// ...
// ...
// ------------------------------------------------------------------------
// The GetPop3SslServerCert method is deprecated:
CkCert certObj = mailman.GetPop3SslServerCert();
if (mailman.get_LastMethodSuccess() == false) {
System.out.println(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 POP3 email server certificate..
boolean useSmtp = false;
CkCert certOut = new CkCert();
success = mailman.GetServerCert(useSmtp,certOut);
if (success == false) {
System.out.println(mailman.lastErrorText());
return;
}
}
}