SMTP Email Issues

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
ryantray
Newbie
Posts: 6
Joined: Thu Mar 26, 2015 3:44 pm

SMTP Email Issues

Post by ryantray » Fri Mar 27, 2015 10:49 am

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

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: SMTP Email Issues

Post by mightycpa » Fri Mar 27, 2015 12:51 pm

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

ryantray
Newbie
Posts: 6
Joined: Thu Mar 26, 2015 3:44 pm

Re: SMTP Email Issues

Post by ryantray » Fri Mar 27, 2015 12:55 pm

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.

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: SMTP Email Issues

Post by mightycpa » Fri Mar 27, 2015 1:13 pm

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

ryantray
Newbie
Posts: 6
Joined: Thu Mar 26, 2015 3:44 pm

Re: SMTP Email Issues

Post by ryantray » Fri Mar 27, 2015 1:25 pm

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!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts