Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Transition from MailMan.FetchEmail to MailMan.FetchByUidl
Provides instructions for replacing deprecated FetchEmail method calls with FetchByUidl.Chilkat Delphi DLL Downloads
var
success: Boolean;
mailman: HCkMailMan;
uidl: PWideChar;
emailObj: HCkEmail;
headerOnly: Boolean;
numBodyLines: Integer;
emailOut: HCkEmail;
begin
success := False;
mailman := CkMailMan_Create();
// ...
// ...
uidl := '123';
// ------------------------------------------------------------------------
// The FetchEmail method is deprecated:
emailObj := CkMailMan_FetchEmail(mailman,uidl);
if (CkMailMan_getLastMethodSuccess(mailman) = False) then
begin
Memo1.Lines.Add(CkMailMan__lastErrorText(mailman));
Exit;
end;
// ...
// ...
CkEmail_Dispose(emailObj);
// ------------------------------------------------------------------------
// Do the equivalent using FetchByUidl.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
headerOnly := False;
// Irrelevant because we are not downloading headers-only.
numBodyLines := 0;
emailOut := CkEmail_Create();
success := CkMailMan_FetchByUidl(mailman,uidl,headerOnly,numBodyLines,emailOut);
if (success = False) then
begin
Memo1.Lines.Add(CkMailMan__lastErrorText(mailman));
Exit;
end;
CkMailMan_Dispose(mailman);
CkEmail_Dispose(emailOut);