Classic ASP
Classic ASP
Transition from Imap.FetchSingleHeader to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set imap = Server.CreateObject("Chilkat.Imap")
' ...
' ...
' ------------------------------------------------------------------------
' The FetchSingleHeader method is deprecated:
' emailObj is a Chilkat.Email
Set emailObj = imap.FetchSingleHeader(1,0)
If (imap.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( imap.LastErrorText) & "</pre>"
Response.End
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using FetchEmail.
' Your application creates a new, empty Email object which is passed
' in the last argument and filled upon success.
headerOnly = 1
set emailOut = Server.CreateObject("Chilkat.Email")
success = imap.FetchEmail(headerOnly,1,0,emailOut)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( imap.LastErrorText) & "</pre>"
Response.End
End If
%>
</body>
</html>