Code
Result

PHP code example: openssl_pkcs7_sign

Sign an S/MIME message. See documentation.

You can try this function yourself. Just edit the code and on "Run" to see the result.