Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Trap the error msg from Mime::Lite

by chrism01 (Friar)
on Jan 22, 2008 at 07:11 UTC ( [id://663515]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Trap the error msg from Mime::Lite
in thread Trap the error msg from Mime::Lite

As per my orig post, I did it deliberately, in order to force the error, so I could test the error handling....
Unfortunately I can't 'grab' the error msg for further processing....
  • Comment on Re^4: Trap the error msg from Mime::Lite

Replies are listed 'Best First'.
Re^5: Trap the error msg from Mime::Lite
by hipowls (Curate) on Jan 22, 2008 at 07:39 UTC

    send spawns out to sendmail. If you have Net::SMTP installed you can use

    eval { $msg->send_by_smtp; }; if ($@) { # handle error }

Re^5: Trap the error msg from Mime::Lite
by Corion (Patriarch) on Jan 22, 2008 at 07:32 UTC

    I'm stupid and didn't read your message, sorry!

    I think the string you see comes from the sendmail program directly. Maybe you can close STDERR in the hope that that will shut up the sendmail error output. Otherwise, you could skip using sendmail and talk SMTP directly, but not every machine is set up for that either:

    $msg->send('smtp','some.host.local');
Re^5: Trap the error msg from Mime::Lite
by chrism01 (Friar) on Jan 23, 2008 at 00:01 UTC
    Hi guys,
    tried both those, but got 'Error: Failed to connect to mail server: Connection refused at ./m.pl line 53' in both cases.
    Seems it doesn't like smtp... weird huh?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://663515]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found