C++
C++
Transition from MailMan.GetAllHeaders to MailMan.FetchAll
Provides instructions for replacing deprecated GetAllHeaders method calls with FetchAll.Chilkat C++ Downloads
#include <CkMailMan.h>
#include <CkEmailBundle.h>
void ChilkatSample(void)
{
bool success = false;
CkMailMan mailman;
// ...
// ...
int numBodyLines = 5;
// ------------------------------------------------------------------------
// The GetAllHeaders method is deprecated:
CkEmailBundle *bundleObj = mailman.GetAllHeaders(numBodyLines);
if (mailman.get_LastMethodSuccess() == false) {
std::cout << mailman.lastErrorText() << "\r\n";
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 = true;
CkEmailBundle bundleOut;
success = mailman.FetchAll(keepOnServer,headersOnly,numBodyLines,bundleOut);
if (success == false) {
std::cout << mailman.lastErrorText() << "\r\n";
return;
}
}