From 0bdae1eced79650fd64c66cdf2107a8f2d0b9067 Mon Sep 17 00:00:00 2001 From: khoff Date: Wed, 11 Jun 2003 20:27:18 +0000 Subject: [PATCH] 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. --- FS/FS/Misc.pm | 13 ++++++++++--- 1 file 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 -- 2.20.1