Question

Currently, our company emails out reports to clients that are built using monospace font.

Ex.

Source                                    Count    Male   Female
----------------------------------------------------------------
ABC      A Brand Name Company                  106     35     71
DEF      Default Earth Factories                 1      0      1
GHI      Greater Height Industries               1      0      1
JKL      Jo King Limited                         0      0      0

The reports are built directly into the body of .eml files which are stored on our server.

Our legacy Delphi 7 program then emails this to the clients who receive and open it via Outlook, and it results in jagged text. (They do not want to change their Outlook settings to display these reports properly.)

procedure Report_Function(Sender: TObject);
var
  F: Textfile;
  filename: string;
begin
  filename := 'N:\Reports\' + LowerCase(fMainMenu.Org) + '.eml';
  AssignFile(F, filename);
  try
    Rewrite(F);
    Writeln(f, Nice(qrRegSum.qrlDescription.Caption, 36) + '  Count    Male   Female');
    Writeln(f, '------------------------------------------------------------');
    while (not dmReports.qSiteInfo.EOF) do  // Populate Report
    begin
      dmReports.qSiteInfo.Next;
    end;
  finally
    CloseFile(f);
  end;
  SendEmail(Filename, Subject);
end;

Is there a way to enforce monospace font display of an email (using Delphi 7)?

Was it helpful?

Solution

You need to format the email using HTML or RTF, then you can embed font information in it. If you are formatting the email as plain text, you lose all control over its font formatting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top