Xojo Plugin
Xojo Plugin
Transition from MailMan.LoadXmlEmail to Email.SetFromXmlText
Provides instructions for replacing deprecated LoadXmlEmail method calls with Email.SetFromXmlText.Chilkat Xojo Plugin Downloads
Dim success As Boolean
success = False
Dim mailman As New Chilkat.MailMan
// ...
// ...
Dim xmlFilePath As String
xmlFilePath = "c:/test/example.xml"
// ------------------------------------------------------------------------
// The LoadXmlEmail method is deprecated:
Dim emailObj As Chilkat.Email
emailObj = mailman.LoadXmlEmail(xmlFilePath)
If (mailman.LastMethodSuccess = False) Then
System.DebugLog(mailman.LastErrorText)
Return
End If
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using Email.SetFromXmlText.
Dim sb As New Chilkat.StringBuilder
success = sb.LoadFile(xmlFilePath,"utf-8")
If (success = False) Then
System.DebugLog(sb.LastErrorText)
Return
End If
Dim email As New Chilkat.Email
success = email.SetFromXmlText(sb.GetAsString())
If (success = False) Then
System.DebugLog(email.LastErrorText)
Return
End If