X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FMisc.pm;h=d973feb9f4cd98c5f0891c36a4dc10bc24301f32;hb=6097db7667840f4a65c0012da009528635a7f82e;hp=39be1fb5ab9866ab25f3f641f0f935e5ae5b6384;hpb=3b1d4f57601233548ea150c74008db47a953462e;p=freeside.git diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index 39be1fb5a..d973feb9f 100644 --- a/FS/FS/Misc.pm +++ b/FS/FS/Misc.pm @@ -343,14 +343,14 @@ sub send_email { $smtp_opt{'port'} = $port; my $transport; - if ( $enc eq 'starttls' ) { + if ( defined($enc) && $enc eq 'starttls' ) { $smtp_opt{$_} = $conf->config("smtp-$_") for qw(username password); $transport = Email::Sender::Transport::SMTP::TLS->new( %smtp_opt ); } else { if ( $conf->exists('smtp-username') && $conf->exists('smtp-password') ) { $smtp_opt{"sasl_$_"} = $conf->config("smtp-$_") for qw(username password); } - $smtp_opt{'ssl'} = 1 if $enc eq 'tls'; + $smtp_opt{'ssl'} = 1 if defined($enc) && $enc eq 'tls'; $transport = Email::Sender::Transport::SMTP->new( %smtp_opt ); }