Interaction and email - NAV 5.01

Hello,

I would like to know if it is possible to send an email through an interaction with an attached document such as a pdf and in the same time a text in the body.

I tried but i did not succeed :

I sent mails with a body but not attachement or mails with an attachement but no body :frowning:

Thanks in advance for your help

SG

You can either use the functions provided by the Mail CU (397) or the SMTP Mail CU (400).

When you send mail using CU 400 you can use:

SMTPMail.CreateMessage(‘Andrea Hansen’, ‘ah@cronus.com’, ‘jr@cronus.com’, ‘This is the subject of the Mail’,‘This is some body Text’, false);
SMTPMail.AppendBody(‘More Body Text’);
SMTPMail.AppendBody(‘Even More Body Text’);
SMTPMail.AppendBody(‘Some More Body Text’);
SMTPMail.AddAttachment(‘C:\Test.pdf’);
SMTPMail.Send();

If you are ready to look to an alternative report distribution solution than DocumentBurster - http://www.pdfburst.com/ it is easy to set up and does not require any coding at all. It can distribute attached reports by email and can have configurable subject and body for the distributed email. Hope this will help.