private function PHPMailer::mailPassthru

5.x PHPMailer.php private PHPMailer::mailPassthru($to, $subject, $body, $header, $params)

Call mail() in a safe_mode-aware fashion. Also, unless sendmail_path points to sendmail (or something that claims to be sendmail), don't pass params (not a perfect fix, but it will do).

Parameters

string $to To:

string $subject Subject:

string $body Message Body:

string $header Additional Header(s):

string|null $params Params:

Return value

bool

1 call to PHPMailer::mailPassthru()
PHPMailer::mailSend in inc/PHPMailer/src/PHPMailer.php
Send mail using the PHP mail() function.

File

inc/PHPMailer/src/PHPMailer.php, line 801

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

private function mailPassthru($to, $subject, $body, $header, $params) 
 {
  //Check overloading of mail function to avoid double-encoding
  if (ini_get('mbstring.func_overload') & 1) {
    $subject = $this->secureHeader($subject);
  }
  else {
    $subject = $this->encodeHeader($this->secureHeader($subject));
  }
  //Calling mail() with null params breaks
  if (!$this->UseSendmailOptions or null === $params) {
    $result = @mail($to, $subject, $body, $header);
  }
  else {
    $result = @mail($to, $subject, $body, $header, $params);
  }

  return $result;
}