wiki/content/20201117104659-dkim_email_authentication.md

33 lines
683 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-17
2024-05-06 20:40:05 +00:00
id: fd4d659f-01f1-4246-87ec-b8073a363402
title: DKIM Email Authentication
---
# Description
DKIM[^1] is supported by the [Mailer
Component](20201112135249-mailer_component). There is also
documentation[^2].
# Syntax
``` php
use Symfony\Component\Mime\Crypto\DkimSigner;
use Symfony\Component\Mime\Email;
$email = (new Email())
->from('hello@example.com')
// ...
->html('...');
$signer = new DkimSigner('file:///path/to/private-key.key', 'example.com', 'sf');
$signedEmail = $signer->sign($email);
```
# Footnotes
[^1]: <https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail>
[^2]: <https://symfony.com/doc/master/mailer.html#dkim-signer>