Sample code for 30+ languages & platforms
Visual FoxPro

Transition from MailMan.FetchSingleHeaderByUidl to MailMan.FetchByUidl

Provides instructions for replacing deprecated FetchSingleHeaderByUidl method calls with FetchByUidl.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loMailman
LOCAL lnNumBodyLines
LOCAL lcUidl
LOCAL loEmailObj
LOCAL lnHeaderOnly
LOCAL loEmailOut

lnSuccess = 0

loMailman = CreateObject('Chilkat.MailMan')

* ...
* ...

lnNumBodyLines = 5
lcUidl = "123"

* ------------------------------------------------------------------------
* The FetchSingleHeaderByUidl method is deprecated:

loEmailObj = loMailman.FetchSingleHeaderByUidl(lnNumBodyLines,lcUidl)
IF (loMailman.LastMethodSuccess = 0) THEN
    ? loMailman.LastErrorText
    RELEASE loMailman
    CANCEL
ENDIF

* ...
* ...

RELEASE loEmailObj

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

lnHeaderOnly = 1

loEmailOut = CreateObject('Chilkat.Email')
lnSuccess = loMailman.FetchByUidl(lcUidl,lnHeaderOnly,lnNumBodyLines,loEmailOut)
IF (lnSuccess = 0) THEN
    ? loMailman.LastErrorText
    RELEASE loMailman
    RELEASE loEmailOut
    CANCEL
ENDIF

RELEASE loMailman
RELEASE loEmailOut