Commit 0630b4c6 authored by Dimitri's avatar Dimitri Committed by Cecilia Vela Gurovic
Browse files

Bug 1713441: set a custom SMTP port in case no SMTP user name is specified

behatnotneeded

Change-Id: Id1a1d1e99d58b9b2c3567ee36eebaeb70c9944e6
parent 5a911c57
...@@ -753,13 +753,13 @@ function email_user($userto, $userfrom, $subject, $messagetext, $messagehtml='', ...@@ -753,13 +753,13 @@ function email_user($userto, $userfrom, $subject, $messagetext, $messagehtml='',
$mail->IsSMTP(); $mail->IsSMTP();
// use SMTP directly // use SMTP directly
$mail->Host = get_config('smtphosts'); $mail->Host = get_config('smtphosts');
$mail->Port = is_numeric(get_config('smtpport')) ? get_config('smtpport') : 25;
if (get_config('smtpuser')) { if (get_config('smtpuser')) {
// Use SMTP authentication // Use SMTP authentication
$mail->SMTPAuth = true; $mail->SMTPAuth = true;
$mail->Username = get_config('smtpuser'); $mail->Username = get_config('smtpuser');
$mail->Password = get_config('smtppass'); $mail->Password = get_config('smtppass');
$mail->SMTPSecure = get_config('smtpsecure'); $mail->SMTPSecure = get_config('smtpsecure');
$mail->Port = get_config('smtpport');
if (get_config('smtpsecure') && !get_config('smtpport')) { if (get_config('smtpsecure') && !get_config('smtpport')) {
// Encrypted connection with no port. Use default one. // Encrypted connection with no port. Use default one.
if (get_config('smtpsecure') == 'ssl') { if (get_config('smtpsecure') == 'ssl') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment