Sample code for 30+ languages & platforms
Lianja Requires Chilkat v11.0.0+

Transition from Email.CreateDsn to Email.ToDsn

Provides instructions for replacing deprecated CreateDsn method calls with ToDsn.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loEmail = createobject("CkEmail")

//  ...
//  ...

lcExplanation = "..."
lcStatusFieldsXml = "..."
llHeaderOnly = .F.

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

loEmailObj = loEmail.CreateDsn(lcExplanation,lcStatusFieldsXml,llHeaderOnly)
if (loEmail.LastMethodSuccess = .F.) then
    ? loEmail.LastErrorText
    release loEmail
    return
endif

//  ...
//  ...

release loEmailObj

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

loDsnEmail = createobject("CkEmail")
llSuccess = loEmail.ToDsn(lcExplanation,lcStatusFieldsXml,llHeaderOnly,loDsnEmail)
if (llSuccess = .F.) then
    ? loEmail.LastErrorText
    release loEmail
    release loDsnEmail
    return
endif



release loEmail
release loDsnEmail