X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FMisc.pm;h=efad2dfd6027bc5eae5af55a87b1027ca7892778;hp=56dc72e36ec061f6d42170a59f712f6e1aed9d6a;hb=729eaf2e7c8e110432a8f4953cba1e4b78e45db5;hpb=fd9138f66cf7f3ab9557e0beebb4e2657a59e34c diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index 56dc72e36..efad2dfd6 100644 --- a/FS/FS/Misc.pm +++ b/FS/FS/Misc.pm @@ -54,7 +54,7 @@ FS::UID->install_callback( sub { } ); sub send_email { - my(%options) = shift; + my(%options) = @_; $ENV{MAILADDRESS} = $options{'from'}; my $to = ref($options{to}) ? join(', ', @{ $options{to} } ) : $options{to}; @@ -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