cleaned up logic

pull/1602/head
mdrush 2016-08-27 16:16:01 -07:00
parent 16a9de3b1b
commit 69a71b1a37
1 changed files with 18 additions and 20 deletions

View File

@ -798,12 +798,12 @@ sub sendEmail
### Send the Message
if ( $Config{ZM_SSMTP_MAIL} ) {
my $ssmtp_location = $Config{ZM_SSMTP_PATH};
if( !$ssmtp_location ) {
if ( !$ssmtp_location ) {
if ( logDebugging() ) {
Debug( "which ssmtp: $ssmtp_location - set ssmtp path in options to suppress this message\n" );
}
$ssmtp_location = qx('which ssmtp');
}
if ( !$ssmtp_location ) {
Debug( "Can't find ssmtp, trying MIME::Lite->send" );
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
@ -812,7 +812,6 @@ sub sendEmail
### Send using SSMTP
$mail->send( 'sendmail', $ssmtp_location, $Config{ZM_EMAIL_ADDRESS} );
}
}
} else {
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
$mail->send();
@ -913,12 +912,12 @@ sub sendMessage
### Send the Message
if ( $Config{ZM_SSMTP_MAIL} ) {
my $ssmtp_location = $Config{ZM_SSMTP_PATH};
if( !$ssmtp_location ) {
if ( !$ssmtp_location ) {
if ( logDebugging() ) {
Debug( "which ssmtp: $ssmtp_location - set ssmtp path in options to suppress this message\n" );
}
$ssmtp_location = qx('which ssmtp');
}
if ( !$ssmtp_location ) {
Debug( "Can't find ssmtp, trying MIME::Lite->send" );
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
@ -927,7 +926,6 @@ sub sendMessage
### Send using SSMTP
$mail->send( 'sendmail', $ssmtp_location, $Config{ZM_MESSAGE_ADDRESS} );
}
}
} else {
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
$mail->send();