You are here

function PHPMailer::ServerVar in SMTP Authentication Support 5

Returns the appropriate server variable. Should work with both PHP 4.1.0+ as well as older versions. Returns an empty string if nothing is found. @access private

Return value

mixed

1 call to PHPMailer::ServerVar()
PHPMailer::ServerHostname in ./smtp.module
Returns the server hostname or 'localhost.localdomain' if unknown. @access private

File

./smtp.module, line 1896
Enables drupal to send email directly to an SMTP server using authentication. Uses the PHPMailer class by Brent R. Matzelle.

Class

PHPMailer
PHPMailer - PHP email transport class @package PHPMailer @author Brent R. Matzelle @copyright 2001 - 2003 Brent R. Matzelle

Code

function ServerVar($varName) {
  global $HTTP_SERVER_VARS;
  global $HTTP_ENV_VARS;
  if (!isset($_SERVER)) {
    $_SERVER = $HTTP_SERVER_VARS;
    if (!isset($_SERVER["REMOTE_ADDR"])) {
      $_SERVER = $HTTP_ENV_VARS;
    }

    // must be Apache
  }
  if (isset($_SERVER[$varName])) {
    return $_SERVER[$varName];
  }
  else {
    return "";
  }
}