# Send Appwrite account email with Groundmail

Appwrite sends account management email (email verification, password recovery, magic URL sign-in and team invites) from a shared server unless you set up custom SMTP. Point it at Groundmail and those emails come from your own domain, show up in your Groundmail email log with delivery status, and unlock Appwrite's custom email templates.

This works with Appwrite Cloud projects.

---

## Prerequisites

- A Groundmail account with a [verified sending domain](https://docs.groundmail.dev/domains). A subdomain such as `mail.yourdomain.com` works well.
- An Appwrite Cloud project.

---

## Connect Appwrite

1. In the dashboard, open **Integrations → Appwrite** and click **Connect Appwrite**.
2. Appwrite asks you to sign in and choose which projects Groundmail can access. Groundmail asks only to read and update project settings. Click **Authorize**.
3. Back in Groundmail, pick a project, enter a sender address on your verified domain and a sender name, and click **Turn on Groundmail SMTP**.

Groundmail creates an SMTP credential for that project and turns on custom SMTP with it. Appwrite tests the connection before saving, so if it saves, it works. If the project already uses another SMTP server, Groundmail asks before replacing it. Running it again on the same project replaces the old credential and revokes it.

The credential is listed under **SMTP** as "Appwrite: *project name*", where you can revoke it. The password never appears on screen.

**Disconnect** in Groundmail removes its access to your Appwrite account. Projects you already set up keep sending; revoke their credential under **SMTP** to stop them.

---

## By hand

Create an SMTP credential under **SMTP**, then in the Appwrite Console open your project's **Settings → SMTP**, turn on **Custom SMTP server**, and enter:

| Setting | Value |
|---------|-------|
| Sender name | Your app's name |
| Sender email | An address on your verified domain |
| Server host | `smtp.groundmail.dev` |
| Server port | `587` |
| Username | `groundmail` |
| Password | The SMTP credential |
| Secure protocol | TLS |

Self-hosted Appwrite uses the same settings, set as `_APP_SMTP_HOST`, `_APP_SMTP_PORT`, `_APP_SMTP_SECURE=tls`, `_APP_SMTP_USERNAME` and `_APP_SMTP_PASSWORD`.

---

## Check it works

Trigger a password recovery for a test user in your app. The email appears under **Emails** in the dashboard with its delivery status.
