Sample code for 30+ languages & platforms
Classic ASP

Transition from MailMan.LoadXmlEmail to Email.SetFromXmlText

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

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

set mailman = Server.CreateObject("Chilkat.MailMan")

' ...
' ...

xmlFilePath = "c:/test/example.xml"

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

' emailObj is a Chilkat.Email
Set emailObj = mailman.LoadXmlEmail(xmlFilePath)
If (mailman.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
    Response.End
End If

' ...
' ...

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

set sb = Server.CreateObject("Chilkat.StringBuilder")
success = sb.LoadFile(xmlFilePath,"utf-8")
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( sb.LastErrorText) & "</pre>"
    Response.End
End If

set email = Server.CreateObject("Chilkat.Email")
success = email.SetFromXmlText(sb.GetAsString())
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( email.LastErrorText) & "</pre>"
    Response.End
End If


%>
</body>
</html>