Sample code for 30+ languages & platforms
C#

Transition from MailMan.LoadXmlEmail to Email.SetFromXmlText

Provides instructions for replacing deprecated LoadXmlEmail method calls with Email.SetFromXmlText.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.MailMan mailman = new Chilkat.MailMan();

// ...
// ...

string xmlFilePath = "c:/test/example.xml";

// ------------------------------------------------------------------------
// The LoadXmlEmail method is deprecated:

Chilkat.Email emailObj = mailman.LoadXmlEmail(xmlFilePath);
if (mailman.LastMethodSuccess == false) {
    Debug.WriteLine(mailman.LastErrorText);
    return;
}

// ...
// ...

// ------------------------------------------------------------------------
// Do the equivalent using Email.SetFromXmlText.

Chilkat.StringBuilder sb = new Chilkat.StringBuilder();
success = sb.LoadFile(xmlFilePath,"utf-8");
if (success == false) {
    Debug.WriteLine(sb.LastErrorText);
    return;
}

Chilkat.Email email = new Chilkat.Email();
success = email.SetFromXmlText(sb.GetAsString());
if (success == false) {
    Debug.WriteLine(email.LastErrorText);
    return;
}