> ## Documentation Index
> Fetch the complete documentation index at: https://nuntly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up receiving

> Enable email receiving on your domain. Configure MX records, verify DNS propagation, and start receiving emails.

Before you can receive emails on your domain, you need to enable receiving and add the required MX DNS records. This guide walks you through the process.

## Prerequisites

* A Nuntly account with a verified domain (or a domain in the verification process). See [add a sending domain](/docs/guides/sending-domains) if you have not added one yet.
* Access to the DNS settings of your domain.

## Enable receiving on your domain

### From the dashboard

<Steps>
  <Step title="Go to domains">
    In the dashboard, go to **Domains** and select the domain you want to enable receiving on.
  </Step>

  <Step title="Enable receiving">
    On the domain detail page, find the **Capabilities** section and toggle **Receiving** to enabled.
  </Step>
</Steps>

### With the SDK

You can also enable receiving programmatically by updating the domain capabilities:

```typescript theme={null}
import { Nuntly } from '@nuntly/sdk';

const nuntly = new Nuntly({
  apiKey: process.env.NUNTLY_API_KEY,
});

await nuntly.domains.update('your-domain-id', {
  receiving: true,
});
```

## Configure MX records

After enabling receiving on your domain, you need to add MX records to your DNS configuration. These records tell mail servers to route incoming emails to Nuntly.

<Steps>
  <Step title="Find your MX records">
    On the domain detail page in the dashboard, the required MX records are displayed in the DNS records table. Copy the **Name** and **Value** fields.
  </Step>

  <Step title="Add records to your DNS provider">
    Add the MX records in your DNS provider's control panel. The exact steps depend on your provider. Refer to their documentation for instructions.
  </Step>

  <Step title="Wait for DNS propagation">
    DNS changes can take anywhere from a few minutes to 48 hours to propagate. Nuntly automatically checks for propagation and updates the status on your domain page.
  </Step>
</Steps>

<Note>
  If you already configured DNS records when setting up your sending domain, you may only need to add the receiving MX record. Check the DNS records table on your domain detail page for the complete list.
</Note>

## Verify your setup

Once DNS has propagated and your domain shows a verified status, you can test receiving by sending an email to any address on your domain. By default, a catch-all inbox routes all incoming messages, so you do not need to create a specific inbox first.

You can verify the email was received by:

* Checking the **Messages** section in the dashboard
* Calling the [messages API](/docs/guides/receiving-messages) to list recent messages
* Listening for the `message.received` [webhook event](/docs/guides/receiving-webhooks)

## Troubleshooting

**MX records are configured but no emails are arriving**

Confirm that the MX record values match exactly what is shown in your Nuntly dashboard. Some DNS providers require you to remove trailing dots from record values. Also verify that the domain status shows as verified.

**Emails are arriving but marked as spam**

Nuntly runs automatic security checks on every incoming message. Virus-infected emails are rejected before storage. Spam is stored but the thread is marked as spam — you can filter spam threads using `isSpam` on the [threads API](/docs/guides/receiving-threads).

## Next steps

<CardGroup cols={2}>
  <Card title="Create inboxes" icon="mailbox" href="/docs/guides/receiving-inboxes">
    Set up address-based routing for incoming emails
  </Card>

  <Card title="Receiving events" icon="webhook" href="/docs/guides/receiving-webhooks">
    Subscribe to events when messages arrive
  </Card>
</CardGroup>
