This commit was manufactured by cvs2svn to create tag 'freeside_2_1_0'.
[freeside.git] / FS / FS / Misc.pm
index 895681f..b275c9d 100644 (file)
@@ -353,16 +353,12 @@ sub send_email {
     $smtp_opt{'ssl'} = 1 if defined($enc) && $enc eq 'tls';
     $transport = Email::Sender::Transport::SMTP->new( %smtp_opt );
   }
-  
-  local $@; # just in case
-  eval { sendmail($message, { transport => $transport }) };
-  if(ref($@) and $@->isa('Email::Sender::Failure')) {
-    return ($@->code ? $@->code.' ' : '').$@->message
-  }
-  else {
-    return $@;
-  }
+
+  eval { sendmail($message, { transport => $transport }); };
+  ref($@) eq 'Email::Sender::Failure'
+    ? ( $@->code ? $@->code.' ' : '' ). $@->message
+    : $@;
+
 }
 
 =item send_fax OPTION => VALUE ...