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
March 11, 2025

How to Use FastReport .NET Avalonia on Fedora Workstation with Wayland Protocol

In this article, we will discuss how to run FastReport .NET Avalonia on the "Fedora Workstation 39" operating system with Wayland protocol.
March 07, 2025

How to Create a QR Code with an Image in FastReport .NET

The article figured out how to insert a picture into a QR Code from the report designer FastReport.NET in just a couple of clicks.
February 20, 2025

Using Dot Matrix Printers for Printing Receipts

This article will explore how to integrate a dot matrix printer into the process of creating and outputting reports using FastReport .NET.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.