Sample code for 30+ languages & platforms
Lianja Requires Chilkat v11.0.0+

Transition from Imap.FetchSequenceHeaders to Imap.FetchRange

Provides instructions for replacing deprecated FetchSequenceHeaders method calls with FetchRange.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loImap = createobject("CkImap")

//  ...
//  ...

lnStartSeqNum = 1
lnCount = 5

//  ------------------------------------------------------------------------
//  The FetchSequenceHeaders method is deprecated:

loBundleObj = loImap.FetchSequenceHeaders(lnStartSeqNum,lnCount)
if (loImap.LastMethodSuccess = .F.) then
    ? loImap.LastErrorText
    release loImap
    return
endif

//  ...
//  ...

release loBundleObj

//  ------------------------------------------------------------------------
//  Do the equivalent using FetchRange.
//  Your application creates a new, empty EmailBundle object which is passed 
//  in the last argument and filled upon success.

llHeadersOnly = .T.

loBundleOut = createobject("CkEmailBundle")
llSuccess = loImap.FetchRange(llHeadersOnly,lnStartSeqNum,lnCount,loBundleOut)
if (llSuccess = .F.) then
    ? loImap.LastErrorText
    release loImap
    release loBundleOut
    return
endif



release loImap
release loBundleOut