From: Peter T. <pet...@us...> - 2002-11-28 23:47:49
|
Update of /cvsroot/twiki/twiki/lib/TWiki In directory sc8-pr-cvs1:/tmp/cvs-serv4053 Modified Files: Net.pm Log Message: Codev.ErrorsFromNetSmtpNotDisplayed fix Index: Net.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki/Net.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** Net.pm 10 Nov 2002 09:12:26 -0000 1.18 --- Net.pm 28 Nov 2002 23:47:46 -0000 1.19 *************** *** 227,242 **** $smtp = Net::SMTP->new( $mailHost ); } ! my $status; if ($smtp) { ! $smtp->mail( $from ); ! $smtp->to( @to, { SkipBad => 1 } ); ! $smtp->data( $data ); ! $smtp->dataend(); ! ! # I think this has to occur before the $smtp->quit, ! # otherwise we'll miss the status message for the sending of the mail. ! $status = ($smtp->ok() ? "" : "ERROR: Can't send mail using Net::SMTP" ); ! $smtp->quit(); } else { $status = "ERROR: Can't send mail using Net::SMTP (can't connect to '$mailHost')"; --- 227,241 ---- $smtp = Net::SMTP->new( $mailHost ); } ! my $status = ""; if ($smtp) { ! { ! $smtp->mail( $from ) or last; ! $smtp->to( @to, { SkipBad => 1 } ) or last; ! $smtp->data( $data ) or last; ! $smtp->dataend() or last; ! } ! $status = ($smtp->ok() ? "" : "ERROR: Can't send mail using Net::SMTP. " . $smtp->message ); $smtp->quit(); + } else { $status = "ERROR: Can't send mail using Net::SMTP (can't connect to '$mailHost')"; |