In scalar context, smtpsend returns the number of addresses that the message was...
authorkhoff <khoff>
Wed, 11 Jun 2003 20:27:18 +0000 (20:27 +0000)
committerkhoff <khoff>
Wed, 11 Jun 2003 20:27:18 +0000 (20:27 +0000)
FS/FS/Misc.pm

index 1f95159..efad2df 100644 (file)
@@ -77,9 +77,16 @@ sub send_email {
 
   my $smtpmachine = $conf->config('smtpmachine');
   $!=0;
-  $message->smtpsend( 'Host' => $smtpmachine )
-    or $message->smtpsend( Host => $smtpmachine, Debug => 1 )
-      or return "can't send email to $to via server $smtpmachine with SMTP: $!";
+
+  my $rv = $message->smtpsend( 'Host' => $smtpmachine )
+    or $message->smtpsend( Host => $smtpmachine, Debug => 1 );
+
+  if ($rv) { #smtpsend returns a list of addresses, not true/false
+    return '';
+  } else {
+    return "can't send email to $to via server $smtpmachine with SMTP: $!";
+  }  
+
 }
 
 =head1 BUGS