Click here to Skip to main content
15,889,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using phpmailer to try to send signed emails (S/MIME).

I used this excellent tutorial by John Dalesandro to create a Self-Signed S/MIME Certificate and package it in PKCS12 Format.

I then followed the instructions in PHPMailer S/MIME signing to make cert.crt, cert.key & certchain.pem from my PKCS12 package.

When I sign with the code below I get "Signing Error:" :

$mail->sign(
  '/mypath/cert.crt', 
  '/mypath/cert.key', 
  'mypassword',
  '/mypath/certchain.pem'
);

The emails are sent normally when I don't try to sign the email.

Since there is no explanation at all in my error code, I don't understand what I'm doing wrong.

What I have tried:

<pre>$mail->sign(
  '/mypath/cert.crt', 
  '/mypath/cert.key', 
  'mypassword',
  '/mypath/certchain.pem'
);
Posted

1 solution

So I got a S/MIME certificate in PKCS12 from a external certificate authority. I then made a cert.crt, cert.key & certchain.pem as stated above and now it works.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900