Hello Experts,
How to send an Email automatically when a JOB encounters an error? Here I have created a codeunit which runs the report through JOB after every 24 hours. How can I automate the Email sending if it encounters any error. What code or trigger has to be written to get this functionality. Please suggest!
0
Answers
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
A new function to send an email as:
eMailNotification(ToName : Text[80];CCName : Text[80];BCCName : Text[80];Subject : Text[250];Body : Text[250];AttachFileName : Text[260];OpenDialog : Boolean)
SMTPSetup.GET;
SMTPMail.CreateMessage(SMTPSetup."Email Sendor Name", SMTPSetup."Email Sendor Email",
ToName, Subject, '', TRUE);
SMTPMail.AddCC(CCName);
SMTPMail.AddBCC(CCName);
SMTPMail.AppendBody(Body);
SMTPMail.AppendBody('<BR><BR>');
SMTPMail.AppendBody('<HR>');
SMTPMail.AppendBody('This is an automatically generated mail by NAV');
SMTPMail.Send;