Send mail in phpmailer using DKIM Keys

前端 未结 2 603
粉色の甜心
粉色の甜心 2020-12-13 05:05

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

i search in phpmailer Class file and i found the below

相关标签:
2条回答
  • 2020-12-13 05:39

    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;
    

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

    0 讨论(0)
  • 2020-12-13 05:41

    I have the following experience:

    1. The pair of the keys generated at http://dkim.worxware.com/createkeys.php is probably intended for the SHA1, while the latest version 5.2.14 of the class.phpmailer.php is intended for SHA256.
      The example above was not functional.
    2. I changed all settings and functions in the class.phpmailer.php from SHA256 on SHA1 (I replaced simply all strings SHA256 with the strings SHA1).
      My PHP script for DKIM signature has became functional.
    0 讨论(0)
提交回复
热议问题