使用DKIM键在phpmailer发送邮件 [英] Send mail in phpmailer using DKIM Keys

查看:440
本文介绍了使用DKIM键在phpmailer发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在使用phpmailer发送邮件。现在,如何使用DKIM键发送电子邮件到phpmailer

Currents i am using phpmailer to send mail's. now how its possible to send email in phpmailer with DKIM keys

我在phpmailer类文件中搜索,我发现以下代码

i search in phpmailer Class file and i found the below code

    /**
     * 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 = '';

我可以知道它的可能性。请帮助我

Can i know how its possible. pls help me

推荐答案

如果您查看 PHPMailer单元测试,有一个如何设置DKIM的示例。

If you take a look in the PHPMailer unit tests, there is an example of how to set up DKIM.

这里是超出您已经需要做的发送消息的基础知识(显然更改域,密钥路径和选择器以匹配您的配置,并添加密码,如果您使用);这也假定您打算使用与相同的标识符进行签名从地址:

Here are the basics beyond what you already need to do to send a message (obviously change the domain, key path and selector to match your config, and add a passphrase if you use one); this also assumes that you are intending to sign using the same identifier as your From address:

$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签名。

When you send() the message (and not before), it will use these settings to generate a DKIM signature.

这篇关于使用DKIM键在phpmailer发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆