PHP code example of jv-conseil / dkim-php-mail-signature
1. Go to this page and download the library: Download jv-conseil/dkim-php-mail-signature library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jv-conseil / dkim-php-mail-signature example snippets
use JVconseil\DkimPhpMailSignature\DKIMsign ;
use JVconseil\DkimPhpMailSignature\DKIMconfig ;
// init
$config = new DKIMconfig('/www/inc/config/jv-conseil/dkim-php-mail-signature/config.inc.php') ;
$sign = new DKIMsign(
$config->private_key,
$config->passphrase,
$config->domain,
$config->selector
) ;
// sign
$signed_headers = $sign->get_signed_headers($to, $subject, $message, $headers) ;
// send email
mail($to, $subject, $message, $signed_headers.$headers) ;
use JVconseil\DkimPhpMailSignature\DKIMsign ;
use JVconseil\DkimPhpMailSignature\DKIMconfig ;
// init
$config = new DKIMconfig('/www/inc/config/jv-conseil/dkim-php-mail-signature/config.inc.php') ;
// set: this calls __set()
$config->domain = "mynewdomain.name" ;
// get: this calls __get()
$config->domain ; // => "mynewdomain.name" ;