Sample code for 30+ languages & platforms
C++

Transition from MailMan.LoadEml to Email.LoadEml

Provides instructions for replacing deprecated MailMan.LoadEml method calls with Email.LoadEml.

Chilkat C++ Downloads

C++
#include <CkMailMan.h>
#include <CkEmail.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkMailMan mailman;

    //  ...
    //  ...

    const char *filePath = "c:/dir/example.eml";

    //  ------------------------------------------------------------------------
    //  The MailMan.LoadEml method is deprecated:

    CkEmail *emailObj = mailman.LoadEml(filePath);
    if (mailman.get_LastMethodSuccess() == false) {
        std::cout << mailman.lastErrorText() << "\r\n";
        return;
    }

    //  ...
    //  ...

    delete emailObj;

    //  ------------------------------------------------------------------------
    //  Do the equivalent using Email.LoadEml.

    CkEmail email;
    success = email.LoadEml(filePath);
    if (success == false) {
        std::cout << email.lastErrorText() << "\r\n";
        return;
    }
    }