Is it possible to retrieve the mailserver's response to each command when using Net::SMTP? Here is basically what I want to do:
my $smtp; $smtp = Net::SMTP->new( $mailhost, Timeout =} $tmout ); {print server response here} $smtp->mail( $fromaddr ); {print server response here} $smtp>to( $recip ); {print server response here} $smtp>data(); {print server response here} $smtp>datasend( "To: $recip\n" ); $smtp>datasend( "From: $fromaddr\n" ); $smtp>datasend( "Subject: $subject\n" ); $smtp>datasend( "\n" ); $smtp>datasend( "$body\n" ); $smtp>dataend(); {print server response here} $smtp>quit;
I know I can get the success or failure of each command like this:
but I want to retrieve the actual reply code that the server returns. Any suggestions? InsolentFlunkey$response=$smtp->mail( $fromaddr ); print "$response\n";
In reply to Retrieving server response with Net::SMTP by InsolentFlunkey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |