PHPMailer + SMTPOptions

Hi everybody, I need to pass some options to PHPMailer since the target SMTP host only has a self-signed certificate:

$mailer->SMTPOptions = [
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true,
    ],
];

How can I achieve that in Kirby?

Thanks for any advice!

See Emails | Kirby CMS

Great, thank you for integrating my code snippet into the documentation so quickly … :wink:

But, anyway, maybe you should also point out, that when using the beforeSend callback as a preset, it must be set besides the presets key in the config to work, not within it (which I tried first):

# /site/config/config.php

return [
  'email' => [
    'presets' => [
      ...
    ],
    'beforeSend' => function ($mailer) {
      ...
    }
  ]
];

However, thank you very much for your support, I very appreciate it!

That example was already there