cleaned up logic
parent
16a9de3b1b
commit
69a71b1a37
|
@ -798,20 +798,19 @@ 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 );
|
||||
$mail->send();
|
||||
} else {
|
||||
### Send using SSMTP
|
||||
$mail->send( 'sendmail', $ssmtp_location, $Config{ZM_EMAIL_ADDRESS} );
|
||||
}
|
||||
}
|
||||
if ( !$ssmtp_location ) {
|
||||
Debug( "Can't find ssmtp, trying MIME::Lite->send" );
|
||||
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
|
||||
$mail->send();
|
||||
} else {
|
||||
### Send using SSMTP
|
||||
$mail->send( 'sendmail', $ssmtp_location, $Config{ZM_EMAIL_ADDRESS} );
|
||||
}
|
||||
} else {
|
||||
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
|
||||
|
@ -913,20 +912,19 @@ 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 );
|
||||
$mail->send();
|
||||
} else {
|
||||
### Send using SSMTP
|
||||
$mail->send( 'sendmail', $ssmtp_location, $Config{ZM_MESSAGE_ADDRESS} );
|
||||
}
|
||||
}
|
||||
if ( !$ssmtp_location ) {
|
||||
Debug( "Can't find ssmtp, trying MIME::Lite->send" );
|
||||
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
|
||||
$mail->send();
|
||||
} else {
|
||||
### Send using SSMTP
|
||||
$mail->send( 'sendmail', $ssmtp_location, $Config{ZM_MESSAGE_ADDRESS} );
|
||||
}
|
||||
} else {
|
||||
MIME::Lite->send( "smtp", $Config{ZM_EMAIL_HOST}, Timeout=>60 );
|
||||
|
|
Loading…
Reference in New Issue