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.
SMTPSendMail Timeout
Moderators: Dorian (MJT support), JRL
- tony_smith
- Pro Scripter
- Posts: 70
- Joined: Wed May 14, 2003 8:25 pm
- Location: Vancouver BC Canada
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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....
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!
Bob
A humble man and PROUD of it!
- tony_smith
- Pro Scripter
- Posts: 70
- Joined: Wed May 14, 2003 8:25 pm
- Location: Vancouver BC Canada
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.
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.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
"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.
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!
Bob
A humble man and PROUD of it!