You are here

public function PHPMailer::DKIM_BodyC in SMTP Authentication Support 7

Same name and namespace in other branches
  1. 7.2 smtp.phpmailer.inc \PHPMailer::DKIM_BodyC()

Generate DKIM Canonicalization Body

@access public

Parameters

string $body Message Body:

1 call to PHPMailer::DKIM_BodyC()
PHPMailer::DKIM_Add in ./smtp.phpmailer.inc
Create the DKIM header, body, as new header

File

./smtp.phpmailer.inc, line 2262
The mail handler class in smtp module, based on code of the phpmailer library, customized and relicensed to GPLv2.

Class

PHPMailer
PHPMailer - PHP email transport class NOTE: Requires PHP version 5 or later @package PHPMailer @author Andy Prevost @author Marcus Bointon @copyright 2004 - 2009 Andy Prevost

Code

public function DKIM_BodyC($body) {
  if ($body == '') {
    return "\r\n";
  }

  // stabilize line endings
  $body = str_replace("\r\n", "\n", $body);
  $body = str_replace("\n", "\r\n", $body);

  // END stabilize line endings
  while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") {
    $body = substr($body, 0, strlen($body) - 2);
  }
  return $body;
}