# Receive email on your domain

Turn on receiving for a domain so mail sent to any address on it is stored in Ha Tang and passed to your systems, and know when to use the support inbox instead.

Receiving lets a domain take in email as well as send it. Every message sent to any address on that domain, such as `orders@inbound.mochuong.vn` or `invoices@inbound.mochuong.vn`, is stored in Ha Tang for 30 days and announced to your systems with the `email.received` webhook. It suits automated mail: supplier invoices to process, replies to parse, forms that arrive by email.

> [!TIP]
> If your team should read and answer customer email, connect it to the Inbox instead: see [Support email](https://hatang.dev/help/channels/email-channel). Agents then reply from Ha Tang like in any other channel, and you do not need a developer.
>
> Already receiving on this domain? Add the support address (for example `cskh@` on it) as a support email channel: mail to that one address then goes to the Inbox with no forwarding, and the rest of the domain stays here.

Turning receiving on or off needs the **Manage** level on the Email module.

## Choose the domain

The MX record of a domain decides where all its email goes. Turning on receiving means pointing that MX at Ha Tang, so:

- **Do not** use a domain whose mailboxes already run on Google Workspace, Microsoft 365, Mắt Bão Mail or another service: their mail would stop arriving there. Ha Tang refuses to turn on receiving when the domain already has an MX record pointing elsewhere.
- **Do** use a dedicated subdomain such as `inbound.mochuong.vn`. Add it under **Email → Domains** and verify it like a sending domain. See [Add and verify a sending domain](https://hatang.dev/help/email/add-domain).

A domain whose mail already goes to a support mailbox in the **Customer Support** module cannot be used for receiving either.

## Turn on receiving

1. Open **Email → Domains** and click the domain.
2. In the **Receiving** card, click **Enable**.
3. A **Receiving** row appears in the records: an MX record on the domain itself, priority `10`, pointing at the host shown. Add it at your DNS host. See [Add DNS records at your DNS host](https://hatang.dev/help/email/dns-by-provider).
4. Click **Re-check DNS**. When the receiving record is verified, mail sent to the domain starts arriving.

The receiving record never affects sending: the domain keeps sending even while it is pending.

## See received mail

Received messages are listed under **Email → Emails**, in the **Receiving** tab, newest first. Open one to read it, with its sender, recipients, headers and attachments. **View received mail** on the domain page leads there too.

What to know:

- Mail to **any** address on the domain is accepted; there is no list of mailboxes to create.
- Messages the receiving service flags as spam are stored and marked **Spam**, but do not trigger the webhook, like a spam folder. Messages carrying a virus are dropped.
- Messages and their attachments are kept for **30 days**, then deleted. Copy what you need to keep.

## Pass mail to your systems

To act on each message automatically, add a webhook that listens to `email.received`:

1. Open **Email → Webhooks** and click **Add endpoint**.
2. Enter your endpoint's address and tick `email.received`.

The webhook carries a summary (sender, recipients, subject, attachment list). Your developer then fetches the body and attachments through the API; see the [receiving guide in the developer hub](https://hatang.dev/docs/guides/email/receiving). No-code tools such as Make, Zapier or n8n can receive the webhook too; see [Webhooks](https://hatang.dev/help/integrations/webhooks).

## Turn it off

Click **Disable** in the **Receiving** card, then remove the MX record at your DNS host. Messages already received stay available until their 30 days are over.

## Troubleshooting

| Symptom | Cause | What to do |
|---|---|---|
| **Enable** fails with "already receives mail at…" | The domain's MX points at another mail service | Use a subdomain such as `inbound.yourdomain` |
| **Enable** fails with "A support mailbox in Chat already receives…" | A support mailbox in the **Customer Support** module uses this domain | Use another subdomain, or keep it in the Inbox |
| Nothing arrives | The receiving MX record is missing or not verified yet | Check the **Receiving** row on the domain page and click **Re-check DNS** |
| A message is listed but your system never heard of it | It was flagged as spam, or the webhook endpoint failed | Check the **Spam** mark on the message, and the deliveries under **Email → Webhooks** |
