2012-10-10 58 views
1

我們是最新版本的phpmailer類,並且想通過dkim簽名發送郵件,這個類是提供它的。但在收到郵件的dkim是硬性的。 我創建了密鑰並放入了dns記錄。我已經完成了在線DNS記錄測試,其確定。phpmailer DKIM dkim = hardfail

如何解決這個問題?

的代碼的例子是:

<?php 
$mail->DKIM_domain = "my-domain.us"; 
$mail->DKIM_private = "url/.htkeyprivate"; 
$mail->DKIM_passphrase = "password"; 
$mail->DKIM_selector = 'phpmailer'; 
$mail->Sender = "[email protected]"; 
$mail->From = "my-domain.us"; 
$mail->FromName = "my-domain"; 
$mail->AddAddress("[email protected]", "receiver"); 
$mail->Subject = "Hello"; 
$mail->Body = "Hello World"; 
$mail->Send(); 
?> 

結果: 驗證結果:mx.google.com; spf = neutral(google.com:92.43.143.174既不被apache @ devserv的域的最佳猜測記錄所允許也不被拒絕) [email protected]; dkim = hardfail [email protected]

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 | | Subject:= 20Hello; BH = CcbQDrWvT4E847f1X4iutz2u/CY =; B =3米/ CXrO6xNxoVSx0P1zXjhNy4QwGrixv0 // C8RgoNBUdS2kX8Evqlj3qZbWmZUQnJfc/u83Oi5r58UXueyx4sA ==

+0

我的工作示例https://github.com/breakermind/PHP-DKIM/blob/master/zips/dkim-cron-send.php – 2017-09-26 12:17:41

回答

0

你有沒有爲你的從提供一個語法正確的郵箱:頭。 DKIM的整個想法是減少垃圾郵件,並且沒有正確的電子郵件標題中的地址是一個相當好的指示,表明電子郵件確實可能是垃圾郵件。嘗試:

<?php 
$mail->DKIM_domain = "find-love.us"; 
$mail->DKIM_private = "url/.htkeyprivate"; 
$mail->DKIM_passphrase = "password"; 
$mail->DKIM_selector = 'phpmailer'; 
$mail->Sender = "[email protected]"; 
$mail->From = "[email protected]"; 
$mail->FromName = "find-love.us"; 
$mail->AddAddress("[email protected]", "receiver"); 
$mail->Subject = "Hello"; 
$mail->Body = "Hello World"; 
$mail->Send(); 
?>