fastnloud / zf2-dkim
为 Zend Mail 使用的 DKIM 签名器
v1.0.6
2016-03-14 20:52 UTC
Requires
- php: >=5.3.3
- zendframework/zendframework: >=2.3.0
This package is not auto-updated.
Last update: 2024-09-25 14:07:10 UTC
README
Zend Framework 2 DKIM 签名器。
安装
此模块的安装使用 composer。有关 composer 文档,请参阅 https://getcomposer.org.cn。
php composer.phar require fastnloud/zf2-dkim
创建一个 ./config/autoload/dkim.global.php 和 ./config/autoload/dkim.local.php 文件,其中包含项目 .dist 文件中描述的配置变量值。
使用方法
-
创建 DKIM 域名密钥
-
使用 config.dist 文件配置 DkimSigner
-
签名并发送
**例如在您的控制器中:**$mail = new \Zend\Mail\Message();
$mail->setBody("Hello world!");
$mail->setFrom('from@example.com');
$mail->addTo('to@example.com');
$mail->setSubject('le subject');
// sign message with dkim
$signer = $this->getServiceLocator()->get('DkimSigner');
$signer->signMessage($mail);
// send message
$transport = new \Zend\Mail\Transport\Sendmail();
$transport->send($mail);
就这样。