Sample code for 30+ languages & platforms
Unicode C

Transition from MailMan.GetAllHeaders to MailMan.FetchAll

Provides instructions for replacing deprecated GetAllHeaders method calls with FetchAll.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkMailManW.h>
#include <C_CkEmailBundleW.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkMailManW mailman;
    int numBodyLines;
    HCkEmailBundleW bundleObj;
    BOOL keepOnServer;
    BOOL headersOnly;
    HCkEmailBundleW bundleOut;

    success = FALSE;

    mailman = CkMailManW_Create();

    //  ...
    //  ...

    numBodyLines = 5;

    //  ------------------------------------------------------------------------
    //  The GetAllHeaders method is deprecated:

    bundleObj = CkMailManW_GetAllHeaders(mailman,numBodyLines);
    if (CkMailManW_getLastMethodSuccess(mailman) == FALSE) {
        wprintf(L"%s\n",CkMailManW_lastErrorText(mailman));
        CkMailManW_Dispose(mailman);
        return;
    }

    //  ...
    //  ...

    CkEmailBundleW_Dispose(bundleObj);

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

    keepOnServer = TRUE;
    headersOnly = TRUE;

    bundleOut = CkEmailBundleW_Create();
    success = CkMailManW_FetchAll(mailman,keepOnServer,headersOnly,numBodyLines,bundleOut);
    if (success == FALSE) {
        wprintf(L"%s\n",CkMailManW_lastErrorText(mailman));
        CkMailManW_Dispose(mailman);
        CkEmailBundleW_Dispose(bundleOut);
        return;
    }



    CkMailManW_Dispose(mailman);
    CkEmailBundleW_Dispose(bundleOut);

    }