Delphi ActiveX
Delphi ActiveX
Transition from MailMan.LoadEml to Email.LoadEml
Provides instructions for replacing deprecated MailMan.LoadEml method calls with Email.LoadEml.Chilkat Delphi ActiveX Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
mailman: TChilkatMailMan;
filePath: WideString;
emailObj: IChilkatEmail;
email: TChilkatEmail;
begin
success := 0;
mailman := TChilkatMailMan.Create(Self);
// ...
// ...
filePath := 'c:/dir/example.eml';
// ------------------------------------------------------------------------
// The MailMan.LoadEml method is deprecated:
emailObj := mailman.LoadEml(filePath);
if (mailman.LastMethodSuccess = 0) then
begin
Memo1.Lines.Add(mailman.LastErrorText);
Exit;
end;
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using Email.LoadEml.
email := TChilkatEmail.Create(Self);
success := email.LoadEml(filePath);
if (success = 0) then
begin
Memo1.Lines.Add(email.LastErrorText);
Exit;
end;
end;