Takes two parameters, SubjectPrefix, EmailBody
The two Setup Table Values of Cnw.EmailErrFrom and Cnw.EmailErrTo are initially set to just a -. If both of these values contain an @ (ie a real email address) then whenever a Run Time Error occurs the details will be emailed from and to the respective addresses automatically.
However, if you catch an error in code and need a similar notification with your own debug information provided, you can use the EmailErr command instead of SendEmail to use the same Setup Table Values with less code.
The first parameter of SubjectPrefix will be the start of the email subject line and be followed by " on " & Setup$ "Cnw.Host".
The second parameter of EmailBody may contain any information helpful to the error situation.
[New] WQErrOut | TabStream$
EmailErr "Example Error", ("# Work Query" & $CrLf & WQErrOut)