Hi,
I have created a script, which checks our system performance by monitoring a standard process.
When the elapsed_seconds is >3 I want to send an email to report the issue. When I run from within the program using F9 it works fine, however when I schedule it in Windows Task Scheduler it doesn't email.
Any ideas?
IF>%elapsed_seconds%>3
SMTPSendMail>recipients,mailserver,me,myname,subject,body,
ENDIF
Thanks
Ryan
SMTP Email Issues
Moderators: JRL, Dorian (MJT support)
Re: SMTP Email Issues
If it runs from the scheduler, how long before it hits that code, and if the elapsed time < 3 seconds, does it loop until it becomes > 3 seconds?
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey
Re: SMTP Email Issues
It ends the script if it's < 3 seconds and just writes the result out to a log file.
If > 3 it sends an email if I step the code or run from within Macro Scheduler.
Just for some reason when it runs outside of the Macro Scheduler software it fails.
Example from earlier - elapsed_seconds was 4.48 seconds, however this failed to trigger email. I ran it again inside the Macro Scheduler and 3.22 seconds triggered the email.
If > 3 it sends an email if I step the code or run from within Macro Scheduler.
Just for some reason when it runs outside of the Macro Scheduler software it fails.
Example from earlier - elapsed_seconds was 4.48 seconds, however this failed to trigger email. I ran it again inside the Macro Scheduler and 3.22 seconds triggered the email.
Re: SMTP Email Issues
What does SMTP_RESULT say when it fails? What did the log say? Try putting a WriteLn in the IF to make sure it gets there.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey
Re: SMTP Email Issues
Hi mightycpa. Seems to be working again now! Had to disable every scheduled task (not just macro schedule) and re-enable and seems to have fixed!
Thanks for your help!
Thanks for your help!