Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.Chilkat Delphi DLL Downloads
var
success: Boolean;
imap: HCkImap;
emailObj: HCkEmail;
headerOnly: Boolean;
email: HCkEmail;
begin
success := False;
imap := CkImap_Create();
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingle method is deprecated:
emailObj := CkImap_FetchSingle(imap,1,False);
if (CkImap_getLastMethodSuccess(imap) = False) then
begin
Memo1.Lines.Add(CkImap__lastErrorText(imap));
Exit;
end;
// ...
// ...
CkEmail_Dispose(emailObj);
// ------------------------------------------------------------------------
// Do the equivalent using FetchEmail.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
headerOnly := False;
email := CkEmail_Create();
success := CkImap_FetchEmail(imap,headerOnly,1,False,email);
if (success = False) then
begin
Memo1.Lines.Add(CkImap__lastErrorText(imap));
Exit;
end;
CkImap_Dispose(imap);
CkEmail_Dispose(email);