Customizing Dynamics NAV
Discover different ways to customize the application to give you and your colleagues access to the features, functionality, and data that you need most.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
I want to send a email automatically in NAV 2016,
This is my code
Path := 'C:\\Temp'+PdfDocPath; // Directory + Path
CLEAR(ABC); // ABC is a Report 50088
ABC.USEREQUESTPAGE(FALSE); //// for filteration
IF NOT ABC.SAVEASPDF(Path) THEN
ERROR('PDF Creating Failed!\\ERROR:\\' + GETLASTERRORTEXT);
SMTP.CreateMessage('Jonas Wood','email@example.com','','Outstanding Amount','',TRUE) ;
SMTP.AppendBody('Dear Sir / Madam,');
SMTP.AppendBody('Please find the Customer Outstading Amount in PDF Format:');
SMTP.AppendBody('Company Accounts Departments ');
i can send a mail but not automatic but i want send a mail automatically in NAV 2016 please give any suggestion.
to run a job (also your code) automatic you can use the job queue, for that follow community.dynamics.com/.../set-up-job-queues-in-dynamics-nav
Thank you very much for your reply i have created the job queue for my report i need to send this report all users Mail. please tell me where i need to add my email id
I would suggest add required email id in the program itself and then schedule to send it using job queue.
Hi Amolthank you for you reply i have added the email in my report cal code even though i did nt get any email.
I'm not sure about your requirement. Please go through the following link which was helpful to me on generating the Customer Statement.
Thanks & Regards,
thank you for your reply i need to send a mail automatically using job queue.please help on this one.
Based on your screenshots I believe it is about generating customer outstanding as a report on a specific date of month (correct me if I'm wrong).
As mentioned earlier by Mr Jonathan, Job queue is the right way to automate it.
I can provide few areas where we need to check for this scenario.
1. After setting up the Job Queue, check the Job Queue Log Entries from Job Queue Entries. Check whether the status is SUCCESS or Failure.
2. Since it is a report from the Customer, ensure there is a Outstanding Amount for that Customer on that period which you are trying the report.
3. Instead of SMTP Mail Codeunit (400), you can try createmessage function from Mail codeunit (397) as it is available in NAV 2016.
Please check your SMTP setup and Test Email Setup to make sure your SMTP Server is working before adding the code.
Thank you for your reply i want to send a report for particular user mail id i have added mail id in report CAL code page.
please see the below screen shot i want to know where i need to add the email id,
Before adding the code, Open SMTP Mail Setup and check your server settings and click the action Test Email Setup to make sure it is working.
The above seems fine to me, check your event viewer for any errors.
my smtp mail test mail is working properly even though i can not receive automatic mail using job queue i have added the code unit user mail
this is my code screen shot
this is my job queue screen shot
i didnt receive any email from job queue (auto mail) but receive smtp test mail please help me on this one
You can used the Job queue for automatically.
Business Applications communities