Skip to content

Commit

Permalink
Core/Email: Sent items didn't have BCC address header since v6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mschering committed Nov 21, 2023
1 parent 702141c commit a416826
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions www/go/core/mail/PHPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,32 @@ private function inlineTextExists(): bool
return false;
}

/**
* Returns the whole MIME message.
* Includes complete headers and body.
* Only valid post preSend().
*
* @see PHPMailer::preSend()
*
* @return string
*/
public function getSentMIMEMessage()
{
$header = $this->MIMEHeader;

// PHPMailer leaves BCC out of headers when using SMTP. We want this header for our sent items
// source. So we append it here.
if (
(
'sendmail' !== $this->Mailer && 'qmail' !== $this->Mailer && 'mail' !== $this->Mailer
)
&& count($this->bcc) > 0
) {
$header .= $this->addrAppend('Bcc', $this->bcc);
}

return static::stripTrailingWSP($header . $this->mailHeader) .
static::$LE . static::$LE . $this->MIMEBody;
}

}

0 comments on commit a416826

Please sign in to comment.