|more useful options|
Trap the error msg from Mime::Liteby chrism01 (Friar)
|on Jan 22, 2008 at 06:06 UTC||Need Help??|
chrism01 has asked for the
wisdom of the Perl Monks concerning the following question:
I'm using Mime::Lite to send an email (with attachment) and I'm testing the error handling.
I can force an error easily enough and it appears in the logfile, but I want to trap the text so I can send an email (via Mail::Mailer) to sysadmin.
The only problem is that the error text is not stored in $! or $@, even if I wrap an eval around the $msg->send statement.
I've tried the web ( eg http://www.perlmonks.org/?node_id=239562) and super search (eg http://www.perlmonks.org/?node_id=563095), but the (very few) examples I've found all seem to assume the error text is in fact stored in $! or $@, as did I, but it deosn't actually seem to be so.
Anyone know how I can get it?