HTML文件作为邮件的正文发送出去?
不就是将Html另存为txt文件就可以了,下面是利用word将Html另存为txt文件
procedure TForm1.HtmToTxt(FileName: string);
var
Ole1, ole2, ole3, ole4: OleVariant;
WordDocument1: TWordDocument;
WordApplication1: TWordApplication;
begin
try
WordApplication1 := TWordApplication.Create(Application);
WordDocument1 := TWordDocument.Create(Application);
Wordapplication1.Connect;
except
MessageDlg('Word 没有安装!!', mtInformation, [mbOk], 0)
Abort;
end;
try
ole1 := FileName;
ole2 := wdOpenFormatAuto;
WordDocument.ConnectTo(Wordapplication1.Documents.Open(Ole1, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, Ole2, EmptyParam, EmptyParam));
ole3 := 'temp.txt';
ole4 := wdFormatText;
WordDocument1.SaveAs(ole3, ole4);
finally
WordApplication1.Disconnect;
WordApplication1.Quit;
WordDocument1.Free;
WordApplication1.Free;
end;
end;