You are here

public function PHPMailer::DKIM_Sign in SMTP Authentication Support 7.2

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

Generate DKIM signature

@access public

Parameters

string $s Header:

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

File

./smtp.phpmailer.inc, line 2212
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_Sign($s) {
  $privKeyStr = file_get_contents($this->DKIM_private);
  if ($this->DKIM_passphrase != '') {
    $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
  }
  else {
    $privKey = $privKeyStr;
  }
  if (openssl_sign($s, $signature, $privKey)) {
    return base64_encode($signature);
  }
}