Sample code for 30+ languages & platforms
C#

Transition from Email.CreateDsn to Email.ToDsn

Provides instructions for replacing deprecated CreateDsn method calls with ToDsn.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Email email = new Chilkat.Email();

//  ...
//  ...

string explanation = "...";
string statusFieldsXml = "...";
bool headerOnly = false;

//  ------------------------------------------------------------------------
//  The CreateDsn method is deprecated:

Chilkat.Email emailObj = email.CreateDsn(explanation,statusFieldsXml,headerOnly);
if (email.LastMethodSuccess == false) {
    Debug.WriteLine(email.LastErrorText);
    return;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using ToDsn.
//  Your application creates a new, empty Email object which is passed 
//  in the last argument and filled upon success.

Chilkat.Email dsnEmail = new Chilkat.Email();
success = email.ToDsn(explanation,statusFieldsXml,headerOnly,dsnEmail);
if (success == false) {
    Debug.WriteLine(email.LastErrorText);
    return;
}