# Enable the email service

To enable email verification for new users or to limit what users can register, you can configure your Datalore On-Premises instance to send emails through an external SMTP server.

By default, the email service is disabled and verification emails are not sent.

Procedure: Enable and configure the email service

Docker deployment:

To enable the email service, specify the following parameters under `environment` in the `docker-compose` file:

Kubernetes deployment:

To enable the email service, specify the following parameters under `dataloreEnv` in the `datalore.values.yaml` file:

`MAIL_SMTP_SERVER`
: String
:
:
:
: SMTP server host
:
:
:
: Default: not defined

`MAIL_SMTP_PORT`
: String
:
:
:
: SMTP server port
:
:
:
: Default: not defined

`MAIL_SMTP_TIMEOUT`
: String (integer ms)
:
:
:
: Maximum time in milliseconds to wait for a response from the SMTP server after sending a command
:
:
:
: Default: `"600000"` (10 minutes)

`MAIL_SMTP_CONNECTION_TIMEOUT`
: String (integer ms)
:
:
:
: Maximum time in milliseconds to wait when establishing the initial connection to the SMTP server
:
:
:
: Default: `"600000"` (10 minutes)

`MAIL_SENDER_EMAIL`
: String
:
:
:
: Sender’s email that Datalore will use in the From field
:
:
:
: Default: not defined

`MAIL_SENDER_NAME`
: String
:
:
:
: Sender’s name
:
:
:
: Default: not defined

`MAIL_SENDER_USERNAME`
: String
:
:
:
: Username of the SMTP user
:
:
:
: Default: not defined

`MAIL_SENDER_PASSWORD`
: String
:
:
:
: Password of the SMTP user
:
:
:
: Default: not defined

`MAIL_ENABLE_STARTTLS`
: String (boolean)
:
:
:
: See the `tcp_keepalive_probes` variable in the [TCP Keepalive HOWTO](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html). Parsed as a boolean.
:
:
:
: Accepted values: `"true"`, `"false"`
:
:
:
: Default: `"false"`

`FORCE_EMAIL_VERIFICATION`
: String (boolean)
:
:
:
: Enables verification emails for new users. Parsed as a boolean.
:
:
:
: If `"false"`, emails of new users are automatically considered verified.
:
:
:
: Accepted values: `"true"`, `"false"`
:
:
:
: Default: `"true"`

`EMAIL_ALLOWLIST_ENABLED`
: String (boolean)
:
:
:
: Restricts new user registrations to emails or domains from the allowlist. Parsed as a boolean.
:
:
:
: You can [manage the email allowlist](manage-email-allowlist.html) in the Admin panel.
:
:
:
: Accepted values: `"true"`, `"false"`
:
:
:
: Default: `"false"`

Example

Docker deployment:

```YAML
services:
  datalore:
    ...
    environment:
      ...
      MAIL_SMTP_SERVER: "email-smtp.your_domain.com"
      MAIL_SMTP_PORT: "465"
      MAIL_SENDER_USERNAME: "email_user"
      MAIL_SENDER_PASSWORD: "pa$$w0rd"
      MAIL_SENDER_EMAIL: "no_reply.datalore@you_domain.com"
      MAIL_SENDER_NAME: "Datalore"
      FORCE_EMAIL_VERIFICATION: "false"
```

Kubernetes deployment:

```YAML
dataloreEnv:
  ...
  MAIL_SMTP_SERVER: "email-smtp.your_domain.com"
  MAIL_SMTP_PORT: "465"
  MAIL_SENDER_USERNAME: "email_user"
  MAIL_SENDER_PASSWORD: "pa$$w0rd"
  MAIL_SENDER_EMAIL: "no_reply.datalore@you_domain.com"
  MAIL_SENDER_NAME: "Datalore"
  FORCE_EMAIL_VERIFICATION: "false"
```

