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.


August 12, 2024

How to build and install the Postgres plugin in FastReport .NET

This article describes how to connect to the database using the FastReport .NET plugin for the report designer from Visual Studio via the NuGet server.
August 08, 2024

How to install FastReport .NET and its components on Windows

Step-by-step instructions for online and manual installation via the FastReport registration code.NET and its components in Windows.
July 26, 2024

Updating HTMLObject as a plugin for FastReport .NET

Detailed instructions for using the new HTMLObject plugin, which uses splitting DOM HTML into FastReport report objects.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314

© 1998-2024 Fast Reports Inc.