You are here

private function PHPMailer::ServerHostname in SMTP Authentication Support 7.2

Same name and namespace in other branches
  1. 5 smtp.module \PHPMailer::ServerHostname()
  2. 7 smtp.phpmailer.inc \PHPMailer::ServerHostname()

Returns the server hostname or 'localhost.localdomain' if unknown. @access private

Return value

string

2 calls to PHPMailer::ServerHostname()
PHPMailer::CreateHeader in ./smtp.phpmailer.inc
Assembles message header. @access public
PHPMailer::SmtpConnect in ./smtp.phpmailer.inc
Initiates a connection to an SMTP server. Returns FALSE if the operation failed. @uses SMTP @access public

File

./smtp.phpmailer.inc, line 1947
The mail handler class in smtp module, based on code of the phpmailer library, customized and relicensed to GPLv2.

Class

PHPMailer
PHPMailer - PHP email transport class NOTE: Requires PHP version 5 or later @package PHPMailer @author Andy Prevost @author Marcus Bointon @copyright 2004 - 2009 Andy Prevost

Code

private function ServerHostname() {
  if (!empty($this->Hostname)) {
    $result = $this->Hostname;
  }
  elseif (isset($_SERVER['SERVER_NAME'])) {
    $result = $_SERVER['SERVER_NAME'];
  }
  else {
    $result = 'localhost.localdomain';
  }
  return $result;
}