当前,我正在使用phpmailer发送邮件。现在如何通过DKIM key 在phpmailer中发送电子邮件
我在phpmailer类文件中搜索,发现以下代码
/**
* DKIM selector.
* @type string
*/
public $DKIM_selector = '';
/**
* DKIM Identity.
* Usually the email address used as the source of the email
* @type string
*/
public $DKIM_identity = '';
/**
* DKIM passphrase.
* Used if your key is encrypted.
* @type string
*/
public $DKIM_passphrase = '';
/**
* DKIM signing domain name.
* @example 'example.com'
* @type string
*/
public $DKIM_domain = '';
/**
* DKIM private key file path.
* @type string
*/
public $DKIM_private = '';
我能知道它的可能性吗。
最佳答案
如果您查看PHPMailer unit tests,那么有一个如何设置DKIM的示例。
这是您发送消息所不需做的基本工作(显然,请更改域,键路径和选择器以匹配您的配置,如果使用,则添加一个密码短语);这也假设您打算使用与From
地址相同的标识符进行签名:
$mail->DKIM_domain = 'example.com';
$mail->DKIM_private = '/path/to/my/private.key';
$mail->DKIM_selector = 'phpmailer';
$mail->DKIM_passphrase = '';
$mail->DKIM_identity = $mail->From;
当您对消息进行
send()
编码时(而不是之前),它将使用这些设置来生成DKIM签名。
关于php - 使用DKIM键在phpmailer中发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24463425/