Java
Java
Transition from MailMan.LoadXmlString to EmailBundle.LoadXmlString
Provides instructions for replacing deprecated LoadXmlString method calls with EmailBundle.LoadXmlString.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();
// ...
// ...
String xmlBundleStr = "...";
// ------------------------------------------------------------------------
// The LoadXmlString method is deprecated:
CkEmailBundle bundleObj = mailman.LoadXmlString(xmlBundleStr);
if (mailman.get_LastMethodSuccess() == false) {
System.out.println(mailman.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using EmailBundle.LoadXmlString.
CkEmailBundle bundle = new CkEmailBundle();
success = bundle.LoadXmlString(xmlBundleStr);
if (success == false) {
System.out.println(bundle.lastErrorText());
return;
}
}
}