logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Forgot password?
    • en
    • ru
    • pt
    • es
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to send report from Delphi program via MAPI protocol
  • How to protect your PDF?

    November 30, 2020

    On the Data protection day, we decided to prepare an article about the PDF documents

    read more
  • How to make a Swiss QR code bill in Delphi or Lazarus

    June 2, 2020

    Lately many countries have been digitizing payment processes. In other words, they convert existing payments

    read more
  • How to create an invoice from a Delphi application

    July 1, 2020

    As for Delphi applications, we understand that we are talking about applications implemented in VCL

    read more
  • Sending reports by E-mail via MAPI protocol

    September 7, 2012

    FastReport.VCL with the very first version uses the original realization of SMTP protocol, written for

    read more
  • How to print business cards from a Delphi application

    August 24, 2020

    Applications built in Delphi are less common than, for example, those built in C #.

    read more

How to send report from Delphi program via MAPI protocol

December 16, 2013

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.


about product download buy
avatar
Aleksey Mandrykin
Senior Developer
VCL MAPI FastReport

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Our team
  • Contact us

© 1998-2021 by Fast Reports Inc.

  • Privacy Policy