more useful options | |
PerlMonks |
How to capture failure of Email::Senderby slugger415 (Monk) |
on Aug 27, 2013 at 16:33 UTC ( [id://1051162]=perlquestion: print w/replies, xml ) | Need Help?? |
slugger415 has asked for the wisdom of the Perl Monks concerning the following question: Hello Monks, this may be a DQ (dumb question), but how do I capture a failure to connect to the SMTP server when using Email::Sender? I've tried to capture the results in a variable: $RES = sendmail($email, { transport => $transport });When it connects to $transport everything works fine, but occasionally it doesn't connect, and I see "unable to connect to SMTP server" and a bunch of trace messages. Those messages don't get put into $RES so the script can't tell if it's failed, and I can't code some appropriate behavior.
In fact it seems that the script crashes when this happens and doesn't continue. I've done some homework on how to catch errors but must be missing something here. thanks!
Back to
Seekers of Perl Wisdom
|
|