Update signed-mail.phps

This commit is contained in:
Nibbels 2015-09-22 01:53:29 +02:00
parent d9b8d4a371
commit b58021454c
1 changed files with 9 additions and 3 deletions

View File

@ -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 certificate 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)
@ -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 key chain file
//!!!! yourSecretPrivateKeyPassword is not the Import Password !!!!
//send the message, check for errors
if (!$mail->send()) {
@ -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.
*/
?>
?>