It turns out the error handling in the
SMTP Email Send Message (Small).vi is something less than optimal, to wit:
Inside the vi, if the
TCP Open Connection fails due to a
malformed server address (or, say, a nonexistent mailserver), it
returns an error code 54. The send message vi, however, in the course
of handling that chains it through a
TCP Write function that passes out an error code of 1 because the
TCP Open also returns a bad handle for further TCP/IP operations, which, of course, is passed to the
TCP Write along with the error cluster... and the
TCP Write returns an error 1 for the bad handle instead of the original error 54
I think this is a bug... The error code passed into the
TCP Write Error In connector should have higher priority than the bad handle.
I have rewritten and saved in one of my libraries the a copy of the VI in which, if
TCP Open fails,
a case structure prevents any further TCPIP transactions from being
attempted and returns the initial Error Code (54 or whatever).
With this modification, I can now capture the error code 54 in my
calling code and treat it as a minor error/warning rather than a
process error that triggers the operator intervention subvi.
Kevin Roche
Advisory Engineer/Scientist
Spintronics and Magnetoelectronics group
IBM Research Almaden