Share |

Thursday, January 14, 2010

How to send a email with attached report from Dynamics NAV

You must previously configure the SMTP, by mean Form 409.

//Create message
cu400.CreateMessage('Sender','sender@mycompany.com',
'recipient1@yourcompany.com;recipient2@yourcompany.com',
'Subject','Body <b>in HTML</b> format.<BR>Regards.',TRUE);
//Generate the report in html format
rpt101.SAVEASHTML(TEMPORARYPATH + 'report101.html');
//Attach file in to email
cu400.AddAttachment(TEMPORARYPATH + 'report101.html');
//Send email
cu400.Send;
//Erase file
ERASE(TEMPORARYPATH + 'report101.html');

2 comments:

Rohit Mathur said...

Respected sir,

I want to enter in the erp field and want to learn navision.
Kindly tell me carrer path in erp field.

Thanking you.

Your's sincerely,
Rohit Mathur
(rohit44x@gmail.com)

Microlabs said...

Hello

Thanks for sharing a nice information about Microsoft Dynamics NAV.