(Unicode C++) Transition from MailMan.LoadEml to Email.LoadEml
Provides instructions for replacing deprecated MailMan.LoadEml method calls with Email.LoadEml. Note: This example requires Chilkat v11.0.0 or greater.
#include <CkMailManW.h>
#include <CkEmailW.h>
void ChilkatSample(void)
{
CkMailManW mailman;
// ...
// ...
const wchar_t *filePath = L"c:/dir/example.eml";
// ------------------------------------------------------------------------
// The MailMan.LoadEml method is deprecated:
CkEmailW *emailObj = mailman.LoadEml(filePath);
if (mailman.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",mailman.lastErrorText());
return;
}
// ...
// ...
delete emailObj;
// ------------------------------------------------------------------------
// Do the equivalent using Email.LoadEml.
CkEmailW email;
bool success = email.LoadEml(filePath);
if (success == false) {
wprintf(L"%s\n",email.lastErrorText());
return;
}
}
|