...
...
if (PrintDialog1.Execute)
then
begin
DateTimeToString(datum, '
dd.mm.yyyy hh:nn:ss', now);
printer.BeginDoc;
Printer.Title := '
MailClient - Mail Drucken';
printer.Canvas.Font.Size := 12;
Printer.Canvas.TextOut(250, 250, '
MailClient');
Printer.Canvas.TextOut(printer.PageWidth - 1210, 250, datum);
printer.Canvas.Font.Size := 10;
printer.Canvas.Pen.Width := 8;
printer.Canvas.MoveTo(250, 370);
printer.Canvas.LineTo(printer.PageWidth - 250, 370);
Printer.Canvas.TextOut(250, 450, '
Von: ' + Msg.From.Text);
Printer.Canvas.TextOut(printer.PageWidth - 1650, 450, '
Empfangen: ' +
DateToStr(Msg.Date) + '
um ' + TimeToStr(Msg.Date));
Printer.Canvas.TextOut(250, 550, '
An: ' + Msg.Recipients.EMailAddresses);
Printer.Canvas.TextOut(250, 650, '
Betr: ' + Msg.Subject);
printer.Canvas.Pen.Width := 8;
printer.Canvas.MoveTo(250, 800);
printer.Canvas.LineTo(printer.PageWidth - 250, 800);
if pos('
Content-Type: text/html', msg.Headers.Text) <> 0
then
begin
WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER)
end
else
begin
for i := 0
to Richedit1.Lines.Count
do
Printer.Canvas.TextOut(250, 950 + (i *
printer.Canvas.TextHeight(Richedit1.Lines.Strings[i])),
Richedit1.Lines.Strings[i]);
end;
Printer.EndDoc;
end;
...
...