我正在使用 open-dkim 和 phpmailer 签署我的外发邮件,我安装了我的密钥,并显示为有效,并且邮件脚本正在运行,但我收到一个阻碍进程的 openSSL 错误:
Warning: openssl_sign() [function.openssl-sign]: supplied key param cannot be coerced into a private key in /usr/share/php/class.phpmailer.php on line 2221
我对openssl一无所知,但我的第一个想法是这个域没有安装SSL,所以也许这是DKIM所必需的??如果是这样,是否像往常一样安装新的 SSL 一样简单,还是我必须以某种方式将公钥/私钥与 SSL 相关联?
谢谢
如果需要完整的脚本:
<?
require_once("class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'mail.domain.com';
$mailer->SMTPAuth = true;
$mailer->Username = 'info@domain.com';
$mailer->Password = 'pass';
$mailer->FromName = 'info@domain.com';
$mailer->From = 'info@domain.com';
$mailer->AddAddress('test@gmail.com','first last');
$mailer->Subject = 'Testing DKIM';
$mailer->DKIM_domain = 'domain.com';
$mailer->DKIM_private = 'private.txt';
$mailer->DKIM_selector = 'default'; //this effects what you put in your DNS record
$mailer->DKIM_passphrase = '';
$mailer->Body = 'this is just an email test';
if(!$mailer->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mailer->ErrorInfo;
exit;
} else {
echo "Message Sent!";
}
?>