# `email.connection_required`

Action emits an email but the application names no email connection.

Area 16, [Built-in services](../topics/built-in-services.md); not declinable; the next step is usually the agent's.

An email is sent through the connection `application { email: }` names,
once the action that emits it commits, so emitting one needs it:






```jadpo
use accounts/types { DisplayName }
use accounts/emails { WelcomeEmail }

/// Welcomes someone who has just signed up.
action welcome(address: Email, name: DisplayName) -> Unit {
    emit WelcomeEmail {
        to: address
        locale: Locale.en_gb
        name: name
    }
}
```

```text
error: `WelcomeEmail` is emitted, but nothing sends email
 --> domains/accounts/actions/welcome.jadpo:6:5
  |
6 |     emit WelcomeEmail {
  |     ^^^^^^^^^^^^^^^^^^^ no email connection
  reason: An email is sent once the action that emits it commits, through the connection `application { email: }` names, from the address its `from:` gives; `app.jadpo` names none.
  next: Declare a connection with `driver: Driver.smtp` in `connections:`, and add `email: { connection: <its name>  from: config.mail_sender }` to `application { }` in `app.jadpo` (agent)
  rule: email.connection_required
  help: https://jadpo.dev/docs/errors/email.connection_required

check failed: 1 error, 5 files
```
