Sample code for 30+ languages & platforms
Delphi DLL

Save Web Page as .mht Web Archive

See more MHT / HTML Email Examples

Downloads a web page into a .mht web archive.

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Mht;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
mht: HCkMht;

begin
success := False;

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

mht := CkMht_Create();

success := CkMht_GetAndSaveMHT(mht,'http://www.bonairefishing.com/','bonairefishing.mht');
if (success <> True) then
  begin
    Memo1.Lines.Add(CkMht__lastErrorText(mht));
    Exit;
  end
else
  begin
    Memo1.Lines.Add('MHT Created!');
  end;

CkMht_Dispose(mht);

end;