Topic: [Script] Send report document to E-mail
How to send report document to E-mail
script:
procedure Form1_bReport_OnAfterClick (Sender: string);
var
sFile: string;
begin
Form1.bReport.Enabled := False;
Form1.bReport.Caption := 'Please wait...';
sFile := Form1.frxPDFExport1.FileName;
if FileExists(sFile) then
if SendMail('smtp.gmail.com', 'yourmail@gmail.com', 'password', 465, 'Your name', 'recipient@yahoo.com', 'Subject', 'Message', sFile) then
ShowMessage('Message sent');
Form1.bReport.Enabled := True;
Form1.bReport.Caption := 'Send PDF to e-mail ';
end;
begin
Form1.frxPDFExport1.OpenAfterExport := False;
end.
Download project: