Signing and Encrypting Messages

Description

Emails can be signed an encrypted using the S/MIME[fn:mime] standard.

Syntax

Signing

use Symfony\Component\Mime\Crypto\SMimeSigner;
use Symfony\Component\Mime\Email;

$email = (new Email())->from(’…’)->to(’…’)->html(’…’);

signedEmail = email);
// now use the Mailer to send this email

Encrypting

use Symfony\Component\Mime\Crypto\SMimeEncrypter;
use Symfony\Component\Mime\Email;

$email = (new Email())->from(’…’)->to(’…’)->html(’…’);

encryptedEmail = email);
// now use the Mailer to send this email

Footnotes

[fn:mime]https://en.wikipedia.org/wiki/S/MIME