modMail: How to sign a email?


I want to sign a email upon generation with cert.
phpmailer can do that. But in modMail there is no implementation.

how can I do that?

thank you in advance


Sign it in what way? DKIM?

Hello Mark,

no DKIM signing.
I mean sign with digital personal signature with certificate.
in PHPMAILER there is the function sign.


The class “modPHPMailer” has a property $mailer that is an instance of “PHPMailer”. So maybe you can access the sign-method through that property:

$modx->getService('mail', 'mail.modPHPMailer');
1 Like

Right, looks like that’s called S/MIME signing. I never used that before.

If your modMail instance is called $mail, you can access the underlying phpmailer instance as $mail->mailer so you can call the sign method on that.

1 Like

that’s it.

thank you so much :pray: