Sample code for 30+ languages & platforms
Classic ASP

Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd.

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")

' ...
' ...

set mset = Server.CreateObject("Chilkat.MessageSet")
success = imap.QueryMbx("FROM joe@example.com",1,mset)
' ...
' ...

' ------------------------------------------------------------------------
' The FetchBundleAsMime method is deprecated:

' saObj is a Chilkat.StringArray
Set saObj = imap.FetchBundleAsMime(mset)
If (imap.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( imap.LastErrorText) & "</pre>"
    Response.End
End If

' ...
' ...

' ------------------------------------------------------------------------
' Do the equivalent using FetchSingleBd.

imap.AutoDownloadAttachments = 1

set bdMime = Server.CreateObject("Chilkat.BinData")
bUid = mset.HasUids
numEmails = mset.Count
i = 0
Do While i < numEmails
    success = imap.FetchSingleBd(mset.GetId(i),bUid,bdMime)
    ' ...
    ' ...

    i = i + 1
Loop

%>
</body>
</html>