# 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.&#x20;

You can see all Kirby email options on the link below

{% embed url="<https://getkirby.com/docs/reference/system/options/email>" %}

### Where to add SMPT config options?

You add SMPT to your config file (**`site/config/`** folder).&#x20;

We suggest you use [Multi-environment config setup](https://www.one.thezero.club/guide/installation/config-options#multi-environment-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](https://getkirby.com/docs/reference/system/options/email#email-transport) should be enough.&#x20;

```
'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](https://getkirby.com/docs/reference/system/options/email#email-transport__email-transport-with-authentication).

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.one.thezero.club/guide/installation/smtp-email-options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
