frxMailExport + PDF Attach
Hi, first of all sorry for my poor english.
Im trying to send a report like this example:
http://www.fast-report.com/en/forum/index....&#entry8856
this is part of my code
procedure TFborrador2.BitBtn4Click(Sender: TObject);
var
qborrador:TfrxADOQuery;
texto,fecha,nombre,dni,datos:TfrxMemoView;
begin
//Cargamos el formulario
iborrador.LoadFromFile('informes/iborrador.fr3');
...
//Lo mandamos por correo electr??nico
frxmailexport1.ShowDialog := False;
frxmailexport1.Address:='maildestino@gmail.com';
frxmailexport1.FromMail := 'loquesea@loquesea.com';
frxmailexport1.Subject := 'Ejemplo 1';
frxmailexport1.SmtpHost := 'smtp.loquesea.ext';
frxmailexport1.SmtpPort := 25;
frxmailexport1.Login := 'login@server.com';
frxmailexport1.Password := 'mipassworddelserver';
frxmailexport1.ExportFilter := frxpdfexport1;
iborrador.Export(frxmailexport1);
end;
It must work! but really the application crash sending this error:
First chance exception at $7C812AEB. Exception class EFCreateError with message 'Cannot create file "C:\DOCUME~1\*******\CONFIG~1\Temp\informes\iborrador.pdf". El sistema no puede hallar la ruta especificada'. Process Gapartados.exe (3712)
Any body knows how to solve this problem?
Thanks everybody !
Im trying to send a report like this example:
http://www.fast-report.com/en/forum/index....&#entry8856
this is part of my code
procedure TFborrador2.BitBtn4Click(Sender: TObject);
var
qborrador:TfrxADOQuery;
texto,fecha,nombre,dni,datos:TfrxMemoView;
begin
//Cargamos el formulario
iborrador.LoadFromFile('informes/iborrador.fr3');
...
//Lo mandamos por correo electr??nico
frxmailexport1.ShowDialog := False;
frxmailexport1.Address:='maildestino@gmail.com';
frxmailexport1.FromMail := 'loquesea@loquesea.com';
frxmailexport1.Subject := 'Ejemplo 1';
frxmailexport1.SmtpHost := 'smtp.loquesea.ext';
frxmailexport1.SmtpPort := 25;
frxmailexport1.Login := 'login@server.com';
frxmailexport1.Password := 'mipassworddelserver';
frxmailexport1.ExportFilter := frxpdfexport1;
iborrador.Export(frxmailexport1);
end;
It must work! but really the application crash sending this error:
First chance exception at $7C812AEB. Exception class EFCreateError with message 'Cannot create file "C:\DOCUME~1\*******\CONFIG~1\Temp\informes\iborrador.pdf". El sistema no puede hallar la ruta especificada'. Process Gapartados.exe (3712)
Any body knows how to solve this problem?
Thanks everybody !
Comments
See my earlier topic : http://www.fast-report.com/en/forum/index....&hl=frxmail
using frxMailExport isn''t a good solution for sending mail and the best way is to use create
a pdf with frxPDFexport and send mail with the INDY components, than you can build
a multi thread solution for sending mail. Othewise your programm is waiting till the
mail is send and than you can use the program.
Regards Peter