Sample code for 30+ languages & platforms
Visual Basic 6.0 Requires Chilkat v11.0.0+

Transition from MailMan.LoadXmlEmail to Email.SetFromXmlText

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

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim mailman As New ChilkatMailMan

'  ...
'  ...

Dim xmlFilePath As String
xmlFilePath = "c:/test/example.xml"

'  ------------------------------------------------------------------------
'  The LoadXmlEmail method is deprecated:

Dim emailObj As ChilkatEmail
Set emailObj = mailman.LoadXmlEmail(xmlFilePath)
If (mailman.LastMethodSuccess = 0) Then
    Debug.Print mailman.LastErrorText
    Exit Sub
End If

'  ...
'  ...

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

Dim sb As New ChilkatStringBuilder
success = sb.LoadFile(xmlFilePath,"utf-8")
If (success = 0) Then
    Debug.Print sb.LastErrorText
    Exit Sub
End If

Dim email As New ChilkatEmail
success = email.SetFromXmlText(sb.GetAsString())
If (success = 0) Then
    Debug.Print email.LastErrorText
    Exit Sub
End If