Email using NAS and Job Queue

ebitasebitas Member Posts: 71
Using NAV v5.0. I have created a codeunit to call a report and save it as an HTML file. Then attaché the file and email it to specific address.
To automate the process I have sat up NAS and created a Job Queue record. The connection between NAS and the Job Queue record is successful, it runs the codeunint and an HTML file is created but for some reason it doesn't fire an email. if I run the codeunint manually everything will work fine and an email is generated.

The codeunint looks like this:


REPORT.SAVEASHTML(77016,'C:\Open Service Orders\OpenSalesOrders.htm',FALSE);

dhbAttachement := 'C:\Open Service Orders\OpenSalesOrders_Elie.htm';
Subject := 'Open Service Orders';
Body := 'Attached is a list of open service orders';
dhbEmail.NewMessage(ToName,'',Subject,Body,dhbAttachement,FALSE);



Note: I'm calling CodeUnit 397 to send the generate an email

the SingleInstance property on the codeunint is set to No.

I have checked the Job Queue Log table, the status is Success and no error messages.


Any Ideas??? Please help!!!

Comments

  • skullaskulla Member Posts: 140
    It depends upon the service account you use to run NAS. Does that user has email setup ?
    If not change the service account to your login id and try.
  • ebitasebitas Member Posts: 71
    Thanks Skulla.. I have sat up an email account but I gave it a name different than the NAS windows Log In. I'll change that and let you know..

    Thank you again for your reply toi my question..
Sign In or Register to comment.