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

Transition from MailMan.FetchSingleHeader to MailMan.FetchOne

Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchOne.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loMailman = createobject("CkMailMan")

//  ...
//  ...

lnNumBodyLines = 5
lnMsgnum = 1

//  ------------------------------------------------------------------------
//  The FetchSingleHeader method is deprecated:

loEmailObj = loMailman.FetchSingleHeader(lnNumBodyLines,lnMsgnum)
if (loMailman.LastMethodSuccess = .F.) then
    ? loMailman.LastErrorText
    release loMailman
    return
endif

//  ...
//  ...

release loEmailObj

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

llHeaderOnly = .T.

loEmailOut = createobject("CkEmail")
llSuccess = loMailman.FetchOne(llHeaderOnly,lnNumBodyLines,lnMsgnum,loEmailOut)
if (llSuccess = .F.) then
    ? loMailman.LastErrorText
    release loMailman
    release loEmailOut
    return
endif



release loMailman
release loEmailOut