(C#) Transition from Email.CreateDsn to Email.ToDsn
Provides instructions for replacing deprecated CreateDsn method calls with ToDsn. Note: This example requires Chilkat v11.0.0 or greater.
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();
bool success = email.ToDsn(explanation,statusFieldsXml,headerOnly,dsnEmail);
if (success == false) {
Debug.WriteLine(email.LastErrorText);
return;
}
|