http://qs321.pair.com?node_id=718593


in reply to Trapping server responses with Net::SMTP

instead of
if ( $smtp->status() =~ /^[45]$/ ) {
you could use
if ( ! $smtp->ok ) {

Replies are listed 'Best First'.
Re^2: Trapping server responses with Net::SMTP
by yaelc (Novice) on Feb 04, 2009 at 12:22 UTC
    which status value indicates success? which indicate failure (other than 4/5)? I tried $smtp->ok and it did not seem to accurately reflect success/failure.