Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Transition from MailMan.FetchSingleHeaderByUidl to MailMan.FetchByUidl
Provides instructions for replacing deprecated FetchSingleHeaderByUidl method calls with FetchByUidl.Chilkat Delphi DLL Downloads
var
success: Boolean;
mailman: HCkMailMan;
numBodyLines: Integer;
uidl: PWideChar;
emailObj: HCkEmail;
headerOnly: Boolean;
emailOut: HCkEmail;
begin
success := False;
mailman := CkMailMan_Create();
// ...
// ...
numBodyLines := 5;
uidl := '123';
// ------------------------------------------------------------------------
// The FetchSingleHeaderByUidl method is deprecated:
emailObj := CkMailMan_FetchSingleHeaderByUidl(mailman,numBodyLines,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 := True;
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);