问题
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
/**
* 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.
回答1:
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.
回答2:
I have the following experience:
- 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. - 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.
回答3:
Start here
http://dkim.worxware.com/
At the bottom - click Continue....this will take you to the tool to generate the private key, public key and how to use them
It will alow you to generate private/public key with instructions
In brief: - seup to send using the private/public key file to add dkim headers in email header - modify DNS txt record for the public key
There are NO tutorials as of today's date - I FOUND it this after gettin g nowhere for a couple months
HTH
来源:https://stackoverflow.com/questions/24463425/send-mail-in-phpmailer-using-dkim-keys