<@U04UQ68083H> How to setup the email sending setu...
# ory-copilot
l
@chilly-king-10285 How to setup the email sending setup in kratos for sending the email through verification flow?
c
A message from kapa.ai
To set up email verification in Ory Kratos, you need to follow these steps: 1. Your identity schema must have an email in its traits. Add the following to it:
Copy code
json {    "<http://ory.sh/kratos|ory.sh/kratos>": {    "verification": {    "via": "email"    }    }   }
For example:
Copy code
json {     "$id": "<https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json>",     "$schema": "<http://json-schema.org/draft-07/schema#>",     "title": "Person",     "type": "object",     "properties": {     "traits": {     "type": "object",     "properties": {     "email": {     "type": "string",     "format": "email",     "title": "E-Mail",     "minLength": 3,     "<http://ory.sh/kratos|ory.sh/kratos>": {     "verification": {     "via": "email"     }     }     }     }     }     }   }
2. Email verification supports sending out a recovery link to an email address. For this to work, you must have the courier SMTP connection configured in your config file:
Copy code
yaml  # Ory Identities    courier:     smtp:     connection_uri: <smtps://username:password@smtp-server:1234/>    # ...
3. You also need to enable verification:
Copy code
yaml  selfservice:     flows:     # login ...     # registration...        verification:     enabled: true     ui_url: <http://127.0.0.1:4455/verification>       # ...
For more information on implementing the UI and details about the payloads, refer to the [Email and Phone Verification and Account Activation Documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation). Sources: - [Account activation and email verification settings](https://www.ory.sh/docs/kratos/self-hosted/account-activation-email-verification)