Unicode C++
Unicode C++
Transition from MailMan.CopyMail to MailMan.FetchAll
Provides instructions for replacing deprecated CopyMail method calls with FetchAll.Chilkat Unicode C++ Downloads
#include <CkMailManW.h>
#include <CkEmailBundleW.h>
void ChilkatSample(void)
{
bool success = false;
CkMailManW mailman;
// ...
// ...
// ------------------------------------------------------------------------
// The CopyMail method is deprecated:
CkEmailBundleW *bundleObj = mailman.CopyMail();
if (mailman.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",mailman.lastErrorText());
return;
}
// ...
// ...
delete 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.
bool keepOnServer = true;
bool headersOnly = false;
// Irrelevent because we are not downloading headers-only.
int numBodyLines = 0;
CkEmailBundleW bundleOut;
success = mailman.FetchAll(keepOnServer,headersOnly,numBodyLines,bundleOut);
if (success == false) {
wprintf(L"%s\n",mailman.lastErrorText());
return;
}
}