# Email

Turn outgoing email off: remove the SMTP settings [`vela enable email`](/docs/enable/email) wrote.

### Syntax

```
$ vela disable email
```

```
$ vela disable email                    # from .env
$ vela disable email -t production      # from a target, and restarts it
```

`PB_SMTP_HOST`, `PB_SMTP_PORT`, `PB_SMTP_TLS`, `PB_SMTP_USERNAME`, `PB_SMTP_PASSWORD`, `PB_SENDER_ADDRESS` and `PB_SENDER_NAME` are removed from `.env`, or from the target's [environment](/docs/env) on the server. With `PB_SMTP_HOST` gone, PocketBase stops sending through SMTP. On a target the instances are restarted so the change takes effect; locally, restart [`vela dev`](/docs/dev).

The command asks before removing anything. When none of the variables is set it says so and changes nothing.

### Options

- `-y, --yes` - Skip the confirmation prompt. Required off a terminal
- `-t, --target <target>` - Which environment: `local`, `all`, `preview`, `preview:<branch>`, `production`, or any bound target such as `staging`. Defaults to `local`
- `--server <ssh>` - Server this target runs on, recorded on first use
- `-i, --identity <file>` - SSH private key to authenticate with
- `--ssh-port <port>` - SSH port
- `--accept-host-keys` - Trust an unknown host key on first connect (CI)

### What is left

Only the environment changes. The names stay in `.env.example`, since the file documents what the app can read, and no code is touched. Each layer is removed separately, like any other variable: settings written with `-t all` are removed with `-t all`.