Skip to content

Commit

Permalink
Merge pull request PHPMailer#504 from Nibbels/master
Browse files Browse the repository at this point in the history
Certificate Chain fix for Thunderbird
  • Loading branch information
Synchro committed Sep 22, 2015
2 parents d9b8d4a + 6672f36 commit b3677b9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/signed-mail.phps
Expand Up @@ -34,6 +34,11 @@
* openssl pkcs12 -in exported-cert.pfx -clcerts -nokeys -out cert.crt
*
* Again, the way you name your certificate is up to you. You will be also asked for the Import Password.
* To create the certificate-chain file use the following command:
*
* openssl pkcs12 -in exported-cert.pfx -cacerts -out certchain.pem
*
* Again, the way you name your chain file is up to you. You will be also asked for the Import Password.
*
*
* STEP 3 - Code (most of the code is copied from the mail.phps example)
Expand Down Expand Up @@ -64,8 +69,9 @@ $mail->addAttachment('images/phpmailer_mini.png');
//signing the email
$mail->sign('/path/to/cert.crt', //the location of your certificate file
'/path/to/cert.key', //the location of your private key file
'yourSecretPrivateKeyPassword'); //the password you protected your private key with (may be empty but parameter can not mit omitted!)
//!!!! This is not the Import Password !!!!
'yourSecretPrivateKeyPassword', //the password you protected your private key with (may be empty but parameter can not mit omitted!)
'/path/to/certchain.pem'); //the location of your chain file
//!!!! yourSecretPrivateKeyPassword is not the Import Password !!!!

//send the message, check for errors
if (!$mail->send()) {
Expand All @@ -79,4 +85,4 @@ if (!$mail->send()) {
* If your email client does not support S/MIME it will most likely just show an attachment smime.p7s which is the signature contained in the email.
* Other clients, such as Thunderbird support S/MIME natively and will validate the signature automatically and report the result in some way.
*/
?>
?>

0 comments on commit b3677b9

Please sign in to comment.