SMTPSendMail Timeout

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

SMTPSendMail Timeout

Post by tony_smith » Mon Sep 19, 2005 8:45 pm

I have found instances when SMTPSendMail suspends a script waiting for port 25 of a mail server. It will wait forever if the server is kaput.

Is there a built-in setting, switch or option to set a timeout for SMTPSendMail?

I have a work-around using PortQry from Microsoft but need to ask the question first.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Sep 19, 2005 9:00 pm

This is not a timeout, but you can use SMTP_RESULT and look for a line beginning with "250". If result not = 250, then can loop for count=x times.

I have used this when I have seen random cases when connection was not made. But I never attributed it to a timeout issue. I will have to keep that in mind the next time I run into this. Thanks for your thoughts on this....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Mon Sep 19, 2005 9:27 pm

But... Not so fast Oh Wise One...

To get SMTP_RESULT, the SMTPSendMail command line must first finish n'est ce pas?

Issue I have is that the command does not finish, it is waiting for port 25 to be in the listening state; forever, for all time, evermore, in perpetuity, indefinitely, ad infinitum and not only that... without cease.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Sep 19, 2005 9:58 pm

"Aha, I see!" said the blind carpenter as he picked up his hammer and saw.

Arrrgh! Even with some other techniques I am thinking of, they will not work either because SMTP never sends a result, it just haaaaaaaaaaaaangs.

Oui, I agree with you, some type of timeout is probably needed here.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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