summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhoff <khoff>2003-06-11 20:27:18 +0000
committerkhoff <khoff>2003-06-11 20:27:18 +0000
commit0bdae1eced79650fd64c66cdf2107a8f2d0b9067 (patch)
tree4aa40885134a89f557ff95aa86d35b538d2fc005
parentf012a5c9f502bc480414686b44c41df0b27c8b2f (diff)
In scalar context, smtpsend returns the number of addresses that the message was successfully delivered to. I'm assuming 'Debug' causes Net::SMTP to warn the debug output, not return it.
-rw-r--r--FS/FS/Misc.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm
index 1f951595a..efad2dfd6 100644
--- a/FS/FS/Misc.pm
+++ b/FS/FS/Misc.pm
@@ -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