C++
C++
Transition from Imap.FetchSequenceHeaders to Imap.FetchRange
Provides instructions for replacing deprecated FetchSequenceHeaders method calls with FetchRange.Chilkat C++ Downloads
#include <CkImap.h>
#include <CkEmailBundle.h>
void ChilkatSample(void)
{
bool success = false;
CkImap imap;
// ...
// ...
int startSeqNum = 1;
int count = 5;
// ------------------------------------------------------------------------
// The FetchSequenceHeaders method is deprecated:
CkEmailBundle *bundleObj = imap.FetchSequenceHeaders(startSeqNum,count);
if (imap.get_LastMethodSuccess() == false) {
std::cout << imap.lastErrorText() << "\r\n";
return;
}
// ...
// ...
delete bundleObj;
// ------------------------------------------------------------------------
// Do the equivalent using FetchRange.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
bool headersOnly = true;
CkEmailBundle bundleOut;
success = imap.FetchRange(headersOnly,startSeqNum,count,bundleOut);
if (success == false) {
std::cout << imap.lastErrorText() << "\r\n";
return;
}
}