Sample code for 30+ languages & platforms
C++

Transition from MailMan.FetchMultiple to MailMan.FetchUidlSet

Provides instructions for replacing deprecated FetchMultiple method calls with FetchUidlSet.

Chilkat C++ Downloads

C++
#include <CkMailMan.h>
#include <CkStringArray.h>
#include <CkStringTable.h>
#include <CkEmailBundle.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkMailMan mailman;

    //  ...
    //  ...

    CkStringArray saUidls;
    saUidls.Append("aaa");
    saUidls.Append("bbb");
    saUidls.Append("ccc");

    CkStringTable stUidls;
    stUidls.Append("aaa");
    stUidls.Append("bbb");
    stUidls.Append("ccc");

    //  ------------------------------------------------------------------------
    //  The FetchMultiple method is deprecated:

    CkEmailBundle *bundleObj = mailman.FetchMultiple(saUidls);
    if (mailman.get_LastMethodSuccess() == false) {
        std::cout << mailman.lastErrorText() << "\r\n";
        return;
    }

    //  ...
    //  ...

    delete bundleObj;

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

    bool headersOnly = false;
    //  Irrelevant because we are not downloading headers-only.
    int numBodyLines = 0;

    CkEmailBundle bundleOut;
    success = mailman.FetchUidlSet(stUidls,headersOnly,numBodyLines,bundleOut);
    if (success == false) {
        std::cout << mailman.lastErrorText() << "\r\n";
        return;
    }
    }