Skip to content

Commit

Permalink
Merge pull request #10785 from kenwest/CRM-20982
Browse files Browse the repository at this point in the history
CRM-20982 Configure the SMTP mailer to identify itself to the SMTP se…
  • Loading branch information
eileenmcnaughton authored Sep 4, 2017
2 parents 74835cb + ef84aa0 commit a754e9c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions CRM/Utils/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,20 @@ public static function createMailer() {
$params['auth'] = FALSE;
}

// set the localhost value, CRM-3153
$params['localhost'] = CRM_Utils_Array::value('SERVER_NAME', $_SERVER, 'localhost');
/*
* Set the localhost value, CRM-3153
* Use the host name of the web server, falling back to the base URL
* (eg when using the PHP CLI), and then falling back to localhost.
*/
$params['localhost'] = CRM_Utils_Array::value(
'SERVER_NAME',
$_SERVER,
CRM_Utils_Array::value(
'host',
parse_url(CIVICRM_UF_BASEURL),
'localhost'
)
);

// also set the timeout value, lets set it to 30 seconds
// CRM-7510
Expand Down

0 comments on commit a754e9c

Please sign in to comment.