Skip to content

metalinspired/laminas-dkim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Laminas Project DKIM Signer.

Note

Based on joepsyko/zf-dkim

Installation

composer require metalinspired/laminas-dkim

Create a ./config/autoload/dkim.global.php and ./config/autoload/dkim.local.php file with the configuration variable values as described in the project .dist files.

Usage

  1. Create a DKIM domain key

  2. Configure the DkimSigner using the config.dist file

  3. Sign & send

$mail = new \Laminas\Mail\Message();
$mail->setBody("Hello world!");
$mail->setFrom('[email protected]');
$mail->addTo('[email protected]');
$mail->setSubject('subject');

// Sign message with dkim
$signer = $this->getServiceLocator()->get(\Dkim\Signer\Signer::class);
$signer->signMessage($mail);

// Send message
$transport = new \Laminas\Mail\Transport\Sendmail();
$transport->send($mail);