Classic ASP
Classic ASP
Transition from MailMan.GetHeaders to MailMan.FetchRange
Provides instructions for replacing deprecated GetHeaders method calls with FetchRange.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set mailman = Server.CreateObject("Chilkat.MailMan")
' ...
' ...
numBodyLines = 3
fromIndex = 0
toIndex = 9
' ------------------------------------------------------------------------
' The GetHeaders method is deprecated:
' bundleObj is a Chilkat.EmailBundle
Set bundleObj = mailman.GetHeaders(numBodyLines,fromIndex,toIndex)
If (mailman.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
Response.End
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using FetchRange.
' Your application creates a new, empty EmailBundle object which is passed
' in the last argument and filled upon success.
keepOnServer = 1
headersOnly = 1
set bundleOut = Server.CreateObject("Chilkat.EmailBundle")
success = mailman.FetchRange(keepOnServer,headersOnly,numBodyLines,fromIndex,toIndex,bundleOut)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
Response.End
End If
%>
</body>
</html>