Sample code for 30+ languages & platforms
Classic ASP

Load MIME from XML

See more MIME Examples

Demonstrates the Chilkat Mime.LoadXml method, which reconstructs a MIME tree from Chilkat's MIME XML. The only argument is the XML string.

Background: Chilkat can represent a MIME tree as XML — headers as elements, parameters as attributes — which is convenient for inspecting or editing structure with XML tools. This is the inverse of GetXml: it rebuilds the full MIME object from that representation. Invalid XML leaves the current object unchanged.

Chilkat Classic ASP Downloads

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

'  Demonstrates the Mime.LoadXml method, which reconstructs a MIME tree from Chilkat's MIME XML.
'  The only argument is the XML string.

set mime = Server.CreateObject("Chilkat.Mime")

'  Chilkat MIME XML (as produced by GetXml).
xmlText = "<mime><contentType>text/plain</contentType><body>Hello.</body></mime>"

success = mime.LoadXml(xmlText)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( mime.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( "Content-Type: " & mime.ContentType) & "</pre>"

%>
</body>
</html>