public function PHPMailer::DKIM_BodyC

5.x PHPMailer.php public PHPMailer::DKIM_BodyC($body)

Generate a DKIM canonicalization body. Uses the 'simple' algorithm from RFC6376 section 3.4.3. Canonicalized bodies should *always* use CRLF, regardless of mailer setting.

Parameters

string $body Message Body:

Return value

string

See also

https://tools.ietf.org/html/rfc6376#section-3.4.3

1 call to PHPMailer::DKIM_BodyC()
PHPMailer::DKIM_Add in inc/PHPMailer/src/PHPMailer.php
Create the DKIM header and body in a new message header.

File

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

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

public function DKIM_BodyC($body) 
 {
  if (empty($body)) {
    return "\r\n";
  }
  // Normalize line endings to CRLF
  $body = static::normalizeBreaks($body, "\r\n");

  //Reduce multiple trailing line breaks to a single one
  return rtrim($body, "\r\n") . "\r\n";
}