Sample code for 30+ languages & platforms
Classic ASP

Transition from Imap.FetchSingle to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.

Chilkat Classic ASP Downloads

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

set imap = Server.CreateObject("Chilkat.Imap")

' ...
' ...

' ------------------------------------------------------------------------
' The FetchSingle method is deprecated:

' emailObj is a Chilkat.Email
Set emailObj = imap.FetchSingle(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 = 0

set email = Server.CreateObject("Chilkat.Email")
success = imap.FetchEmail(headerOnly,1,0,email)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( imap.LastErrorText) & "</pre>"
    Response.End
End If


%>
</body>
</html>