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: