Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

sending report as PDF attachment with Indy

edited July 2010 in Devices
I want to e-mail a report as PDF attachment, without user intervention.

First, I tried sending with MAPI (Outlook). This works, but has a few
disadvantages (security dialog, mails are kept in sent items,...)

Now I want to try with SMTP Indy.
(see 'Send Email directly using Indy' in manual)
But nothing happens, no mail is received.

This is my small program :

uses ppSMTPCustom, ppSMTPIndy10;

...

with ppreport1 do begin
allowPrintToFile := true;
showPrintDialog := false;
PDFSettings.author := 'author';
PDFSettings.title := 'title';
PDFSettings.openPDFFile := false;
EmailSettings.enabled := true;
EmailSettings.subject := 'emailsubject';
EmailSettings.filename := 'document.pdf';
EmailSettings.recipients.add('xxx@yyy.zz'); // my valid email address
EmailSettings.reportformat := 'pdf';
EmailSettings.previewInEmailClient := false;
EmailSettings.showEmailDialog := false;
EmailSettings.hostaddress := 'my host'; // valid host address
tppSMTPPlugin.registerClass(tppSMTPIndy);
SendMail;
end;

Any idea ?

Rbuilder 11.08 Delphi 2009

Comments

This discussion has been closed.