You are here

function MimeMailPHPMailer::CreateHeader in PHPMailer 6

Assembles message header.

PHPMailer always sets Return-Path to Sender, we want more flexibility.

File

includes/mimemail.inc, line 100

Class

MimeMailPHPMailer

Code

function CreateHeader() {
  $old_sender = $this->Sender;
  if ($this->ReturnPath != '') {
    $this->Sender = $this->ReturnPath;
  }
  $result = parent::CreateHeader();

  // Restore sender for use in MAIL FROM command.
  $this->Sender = $old_sender;
  return $result;
}