Sending report from Delphi program via MAPI protocol

2013-12-16

Just copy following code for sending the report from your own application:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
procedure TForm1.Button2Click(Sender: TObject);
var
mail: TfrxMailExport;
txt: TfrxTXTExport;
begin
txt := TfrxTXTExport.Create(nil);
mail := TfrxMailExport.Create(nil);
mail.UseMAPI := MAPI;
mail.Address:='Recepient Name <recepient@earth.xyz>';
mail.ExportFilter:=txt;
mail.FilterDesc:='TXT per E-Mail';
mail.FromMail:='Sender Name <sender@source.xyz>';
mail.Login := '';
mail.Password := '';
mail.Subject:='Subject-Text here';
mail.Lines.Add('Hi there, ' + #13#10#13#10+ 'heres comes an email with attached file');
frxReport1.Export(mail);
mail.Destroy;
end; 

 

 There are two important issues for this example:

  1.  The recepient address must be written in canonical form Name <user@host.net>. Simple forms  - user@host.net will be rejected by some mail clients. For example, Microsoft Outlook require a  canonical form of the recepient address.
  2.  You must set fields Login and Password  with empty values.


VCL VCL MAPI MAPI FastReport FastReport Delphi Delphi
September 08, 2026

Answers to Frequently Asked Questions about the FP3 Format

We'll break down 11 common questions about the FP3 format: what these files are, how they differ from FR3 files, which programs can open them, and how to convert them to PDF.
September 04, 2026

How to export a report from FastReport .NET to DXF

In this article, we will consider methods of exporting a report to the DXF format, and also see what the resulting output looks like after opening the file in a CAD application.
August 03, 2026

How to Export a Report from FastReport .NET to PostScript

In this article, we will look at exporting a FastReport .NET report to the PostScript format, using a practical example to examine parameter configuration and programmatic implementation.

© 1998-2026 Fast Reports Inc.