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

# Troubleshooting

> Learn how to troubleshoot common issues.

## Account issues

### "An account with that email address already exists" or "This email address is already in use"

This typically happens when an account was created for another product, for example, [Inbound Filtering](https://app.mailchannels.com).

**If you have an account with another product** contact [sales@mailchannels.com](mailto:sales@mailchannels.com) to add the Email API to your account.

**If you do not have an account** contact [support@mailchannels.com](mailto:support@mailchannels.com) and the team will help resolve the issue.

**If you are not sure** contact [support@mailchannels.com](mailto:support@mailchannels.com) and the team will help you resolve the issue.

### API actions are returning a successful response, but seem to have no effect

This typically happens when the API key in the X-Api-Key header is not associated with the account you think it is. For example,
if you have an account `examplecorp`, and a sub-account `examplecorp-marketing`, API keys created in the `examplecorp` account
will make API calls that affect the `examplecorp` account, not the `examplecorp-marketing` account. Make sure you are using an API key
that is associated with the account you want to affect.

<Note>
  The only header that is required for the Email API is the X-Api-Key header. Other headers are ignored.
</Note>

## Sending errors

### 550 5.7.1 This sender is not authorized to send from `domain`

This error indicates that the Domain Lockdown record is not properly configured for the sending domain. Make sure that the
Domain Lockdown record is configured and that the DNS record has propagated. For each domain you send from, create a TXT
record at the `_mailchannels` subdomain. For example, if you send from `example.com`, create a TXT record at
`_mailchannels.example.com`. The TXT record should contain the following value:

```
v=mc1 auth=examplecorp
```

where `examplecorp` is your MailChannels account name.

To check that your record has propagated, you can use the [check-domain tool](https://dash.mailchannels.com/domain-health)
or the API. Below are examples of how to use the API to check that the record has propagated.

<CodeGroup>
  ```bash cURL theme={null}
  #!/usr/bin/env bash
  # Check that a domain's DKIM, SPF, and Domain Lockdown records are configured
  # correctly and have propagated.
  set -u
  : "${MAILCHANNELS_API_KEY:?Set MAILCHANNELS_API_KEY before running}"
  : "${DOMAIN:?Set DOMAIN (the sending domain, e.g. example.com)}"

  curl -X POST "https://api.mailchannels.net/tx/v1/check-domain" \
    -H "Content-Type: application/json" \
    -H "X-Api-Key: $MAILCHANNELS_API_KEY" \
    -d @- <<JSON
  {
    "domain": "$DOMAIN"
  }
  JSON
  ```

  ```javascript Node.js theme={null}
  import { MailChannels } from "mailchannels-sdk";

  const { MAILCHANNELS_API_KEY, DOMAIN } = process.env;
  if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");
  if (!DOMAIN) throw new Error("Set DOMAIN (the sending domain, e.g. example.com)");

  const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);

  const { data, error } = await mailchannels.domains.check(DOMAIN);

  if (error) {
    console.error("Check domain failed:", error);
    process.exit(1);
  }
  console.log(data);
  ```

  ```python Python theme={null}
  import os
  import sys

  import mailchannels

  if not os.environ.get("MAILCHANNELS_API_KEY"):
      sys.exit("Set MAILCHANNELS_API_KEY before running")

  domain = os.environ.get("DOMAIN")
  if not domain:
      sys.exit("Set DOMAIN (the sending domain, e.g. example.com)")

  # Check that DKIM, SPF, and Domain Lockdown records are configured correctly
  # and have propagated.
  response = mailchannels.CheckDomain.check(domain)

  print(response)
  ```

  ```php PHP theme={null}
  <?php

  require_once __DIR__ . '/vendor/autoload.php';

  use MailChannels\Client;

  $api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error: MAILCHANNELS_API_KEY is not set\n");
  $domain  = getenv('DOMAIN') or exit("Error: DOMAIN is not set\n");

  $client = new Client(apiKey: $api_key);

  // Check that DKIM, SPF, and Domain Lockdown records are configured correctly
  // and have propagated.
  $response = $client->checkDomain->check($domain);

  print_r($response->toArray());
  ```
</CodeGroup>

### 550 5.1.2 \[SDNF] Sender Domain Not Found.

This error indicates that the sending domain does not have a valid DNS record. Make sure that the sending domain has a
valid A or MX record. Use the check-domain tool to verify that the sending domain has a valid DNS record.

## What to include when contacting support

Include the failed request, the error response, timestamp with time zone, sending domain, sender address, recipient domain,
`request_id` if available, and your account name. The more information you can provide, the faster the team can investigate
and resolve the issue.
