Send mail in phpmailer using DKIM Keys

Asked
Active3 hr before
Viewed126 times

4 Answers

using
90%

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 code , 6 DKIM_identifier is now DKIM_identity (PHPMailer 5.2.13) – gamliela Sep 29 '15 at 13:31 , How to stop blender from purging unused materials when closing

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;
88%

If you take a look in the PHPMailer unit tests, there is an example of how to set up DKIM.,When you send() the message (and not before), it will use these settings to generate a DKIM signature.,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. ,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.

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;
72%

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 code ,I'm hacking some support for DomainKeys and DKIM into an open source email marketing program, which uses a python script to send the actual emails via SMTP. I d...,If you take a look in the PHPMailer unit tests, there is an example of how to set up DKIM.

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 = '';
load more v
65%

The PHP code below uses cPanel email server settings and DKIM signature.Just replace values in {} brackets with your data to make it work:,If you would like to add DKIM signature to your emails that sent via PHPMailer, please follow the steps below.,PHPMailer settings for cPanel email,PHPMailer settings for correct work of emails

PHPMailer settings for cPanel email server

$mail->isSMTP();
$mail->Host = 'xxxxxxxNNNNN.prod.iad2.secureserver.net';
$mail->SMTPSecure = 'SSL';
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = 'mail@mydomain.com';
$mail->Password = 'EMAILPASSWORD';

$mail - > isSMTP();
$mail - > Host = 'xxxxxxxNNNNN.prod.iad2.secureserver.net';
$mail - > SMTPSecure = 'SSL';
$mail - > Port = 587;
$mail - > SMTPAuth = true;
$mail - > Username = 'mail@mydomain.com';
$mail - > Password = 'EMAILPASSWORD';
load more v

Other "using-undefined" queries related to "Send mail in phpmailer using DKIM Keys"