我是最新版本的phpmailer类,并希望通过dkim签名发送邮件,这个类是提供它的。但收到邮件的dkim是艰难的。 我创建了密钥并输入了dns记录。我已经完成了在线dns记录测试,没问题。
如何解决这个问题?
代码的例子是:
<?php
$mail->DKIM_domain = "my-domain.us";
$mail->DKIM_private = "url/.htkeyprivate";
$mail->DKIM_passphrase = "password";
$mail->DKIM_selector = 'phpmailer';
$mail->Sender = "no-reply@my-domain.us";
$mail->From = "my-domain.us";
$mail->FromName = "my-domain";
$mail->AddAddress("toexample@gmail.com", "receiver");
$mail->Subject = "Hello";
$mail->Body = "Hello World";
$mail->Send();
?>
结果: 身份验证 - 结果:mx.google.com; spf =中性(对于apache @ devserv的域名,最佳猜测记录既不允许也不拒绝google.com:92.43.143.174) smtp.mail=apache@devserv; dkim = hardfail header.i=@find-love.us
DKIM-Signature:v = 1; A = RSA-SHA1; Q = DNS / TXT;升= 5; S = PHPMailer的; t = 1349788282 c =放松/简单; H =从:至:主题; d = my-domain.us; z = From:= my-domain = 20 | |主题:= 20Hello; BH = CcbQDrWvT4E847f1X4iutz2u / CY =; B =3米/ CXrO6xNxoVSx0P1zXjhNy4QwGrixv0 // C8RgoNBUdS2kX8Evqlj3qZbWmZUQnJfc / u83Oi5r58UXueyx4sA ==
答案 0 :(得分:0)
您尚未为发件人:标题提供语法正确的电子邮件。 DKIM的整个想法是减少垃圾邮件,并且在电子邮件的标题中没有正确的发件人地址是一个相当好的迹象,表明该电子邮件可能确实是垃圾邮件。尝试:
<?php
$mail->DKIM_domain = "find-love.us";
$mail->DKIM_private = "url/.htkeyprivate";
$mail->DKIM_passphrase = "password";
$mail->DKIM_selector = 'phpmailer';
$mail->Sender = "no-reply@find-love.us";
$mail->From = "no-reply@find-love.us";
$mail->FromName = "find-love.us";
$mail->AddAddress("toexample@gmail.com", "receiver");
$mail->Subject = "Hello";
$mail->Body = "Hello World";
$mail->Send();
?>