Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Transition from Imap.CheckForNewEmail to Imap.QueryMbx
Provides instructions for replacing deprecated CheckForNewEmail method calls with QueryMbx.Chilkat Delphi DLL Downloads
var
success: Boolean;
imap: HCkImap;
msgSetObj: HCkMessageSet;
criteria: PWideChar;
bUid: Boolean;
msgSet: HCkMessageSet;
begin
success := False;
imap := CkImap_Create();
// ...
// ...
// ------------------------------------------------------------------------
// The CheckForNewEmail method is deprecated:
msgSetObj := CkImap_CheckForNewEmail(imap);
if (CkImap_getLastMethodSuccess(imap) = False) then
begin
Memo1.Lines.Add(CkImap__lastErrorText(imap));
Exit;
end;
// ...
// ...
CkMessageSet_Dispose(msgSetObj);
// ------------------------------------------------------------------------
// Do the equivalent using QueryMbx.
// Your application creates a new, empty MessageSet object which is passed
// in the last argument and filled upon success.
criteria := 'new-email';
bUid := True;
msgSet := CkMessageSet_Create();
success := CkImap_QueryMbx(imap,criteria,bUid,msgSet);
if (success = False) then
begin
Memo1.Lines.Add(CkImap__lastErrorText(imap));
Exit;
end;
CkImap_Dispose(imap);
CkMessageSet_Dispose(msgSet);