SMTP email options

Email sending will work out of the box on any server that allows PHP emails. This was a default setting on most servers for many years. But because enhanced security is a very important, and hackers find new ways to intercept PHP emails, many hosting providers disallow PHP emails. Although we suggest adding the SMTP config options even if your server allows sending PHP emails.

You can see all Kirby email options on the link below

Where to add SMPT config options?

You add SMPT to your config file (site/config/ folder).

We suggest you use Multi-environment config setup, to have a cleaner file structure.

Basic SMTP options

If your website is on the same server as your email server the basic SMPT config options should be enough.

'email' => [
    'transport' => [
      'type' => 'smtp',
      'host' => 'smtp.company.com',
      'port' => 465,
      'security' => true
    ]
  ],

SMTP options with authentication

If your website is not on the same server as your email server, or your server has enhanced security you will need to add SMTP config options with authentication.

'email' => [
    'transport' => [
      'type' => 'smtp',
      'host' => 'smtp.server.com',
      'port' => 465,
      'security' => true,
      'auth' => true,
      'username' => '...',
      'password' => '...',
    ]
  ],

Last updated

Was this helpful?