Classic ASP
Classic ASP
Transition from Imap.CheckForNewEmail to Imap.QueryMbx
Provides instructions for replacing deprecated CheckForNewEmail method calls with QueryMbx.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 CheckForNewEmail method is deprecated:
' msgSetObj is a Chilkat.MessageSet
Set msgSetObj = imap.CheckForNewEmail()
If (imap.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( imap.LastErrorText) & "</pre>"
Response.End
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using QueryMbx.
' Your application creates a new, empty MessageSet object which is passed
' in the last argument and filled upon success.
criteria = "new-email"
bUid = 1
set msgSet = Server.CreateObject("Chilkat.MessageSet")
success = imap.QueryMbx(criteria,bUid,msgSet)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( imap.LastErrorText) & "</pre>"
Response.End
End If
%>
</body>
</html>