Reputation: 511
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 = "[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();
?>
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 [email protected]
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==
Upvotes: 1
Views: 2230
Reputation: 697
You have NOT provided a syntactically correct email for your From: header. The whole idea of DKIM is to reduce SPAM, and not having a correct From address in the header of an email is a fairly good indication that the email may indeed be spam. Try:
<?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();
?>
Upvotes: 0