1

I us the latest version of phpmailer class, and want to send mails by dkim signature, this class is provide it. but in received mail's dkim is hardfail. I created keys and put dns record. i have done online dns record test, its ok.

how to solved this problem?

the example of code is:

<?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();
?>

Result: Authentication-Results: mx.google.com; spf=neutral (google.com: 92.43.143.174 is neither permitted nor denied by best guess record for domain of apache@devserv) smtp.mail=apache@devserv; dkim=hardfail header.i=@find-love.us

DKIM-Signature: v=1; a=rsa-sha1; q=dns/txt; l=5; s=phpmailer; t=1349788282 c=relaxed/simple; h=From:To:Subject; d=my-domain.us; z=From:=my-domain=20 | |Subject:=20Hello; bh=CcbQDrWvT4E847f1X4iutz2u/CY=; b=3m/CXrO6xNxoVSx0P1zXjhNy4QwGrixv0//C8RgoNBUdS2kX8Evqlj3qZbWmZUQnJfc/u83Oi5r58UXueyx4sA==

4

1 回答 1

0

您没有为From:标头提供语法正确的电子邮件。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();
?>
于 2012-10-24T03:38:21.937 回答