Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Error message not showing up from Net::SMTP

by sg (Pilgrim)
on Sep 05, 2007 at 17:25 UTC ( [id://637216]=note: print w/replies, xml ) Need Help??


in reply to Re: Error message not showing up from Net::SMTP
in thread Error message not showing up from Net::SMTP

The message in the output came from user code when auth() returned false. The Net::SMTP module has the set status line:
$self->set_status(500, ["Need MIME::Base64 and Authen::SASL todo auth" +]), return 0;
Why didn't the precise error message "Need MIME::Base64 and Authen::SASL todo auth" get to the end-user? Or what exactly should the user have done differently in the user-code to have gotten that precise, informative error message?

Replies are listed 'Best First'.
Re^3: Error message not showing up from Net::SMTP
by menolly (Hermit) on Sep 05, 2007 at 17:53 UTC
    Replace
    print "ERROR: Could not authenticate user $user_id\n$!\n";
    with
    print "ERROR: Could not authenticate user $user_id\n$: ".$mail->messa +ge."\n";
    or equivalent.
      Thanks for the details. Augmenting the print statement with
      $mail->code,':',$mail->message,"\n";
      does indeed display the desired error message.
Re^3: Error message not showing up from Net::SMTP
by ikegami (Patriarch) on Sep 05, 2007 at 18:02 UTC
    Perhaps you should read my entire post instead of focusing on the rhetorical question. It explains why the message isn't returned via $!, and where it can be found.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-06-24 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.