http://www.perlmonks.org?node_id=637226


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

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.

Replies are listed 'Best First'.
Re^4: Error message not showing up from Net::SMTP
by sg (Pilgrim) on Sep 05, 2007 at 20:12 UTC
    Thanks for the details. Augmenting the print statement with
    $mail->code,':',$mail->message,"\n";
    does indeed display the desired error message.