> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/emails/integrations/test.md).

# Test an integration

Test an email integration — send a real test email, confirm it arrived, and check the sender domain.

**Where:** Email → Integrations → an integration · `/projects/<project>/emails/integrations/<integrationId>/edit`

The test sends one real email through the provider, so you know the settings work before a campaign depends on them. You then confirm that the email really arrived — the provider accepting it is not the same as it reaching a mailbox.

## Before you start

* A saved integration — see [Connect a provider](/codemash/cloud/emails/integrations/providers.md). The test panel shows **Run test after successful save.** until the integration is saved.
* An address you can read. Through a real provider the test is a real email.
* Permission `email:execute` to test (built-in **Developer** or **Administrator**; **Viewer** is refused) and `email:manage` for **I received it**.
* The Fake **Test Me** has no test panel: it never delivers, and Norbix marks it **TESTED** and **CONFIRMED** when it is created.

## Steps

1. Open the integration and scroll to the test panel under the form. Type the address in **Test Email Recipient**, for example `ada.lovelace@example.com`.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-d2a6e69dc888ffc562b494291b8d6586ce684314%2Fintegrations-test-1.png?alt=media" alt="Editing SMTP integration Mailpit (local test): Port 2525, Integration Name, Save; test panel with Test Email Recipient ada.lovelace@example.com and Test integration; Sender domain DNS check with Check domain"><figcaption><p>The test panel with a recipient.</p></figcaption></figure>
2. Press **Test integration**. The panel shows **Testing…**, then the result: **Test passed** with **SendEmail Success**, or **Test failed** with the provider's message.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-5468b8c9b2c0e393175cfa48e7ae2d719c712c78%2Fintegrations-test-2.png?alt=media" alt="Test passed, SendEmail Success, and the yellow box Confirm you received the message with the I received it button"><figcaption><p><strong>Test passed</strong>; now confirm the delivery.</p></figcaption></figure>
3. Check the mailbox. When the email ("Norbix email integration test") is there, press **I received it** in **Confirm you received the message**. The button changes to **Delivery confirmed**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-e9d6c6749dc6b1010ada0b1721ca76b9d804b5d0%2Fintegrations-test-4.png?alt=media" alt="Test passed and Delivery confirmed in the test panel"><figcaption><p>Delivery confirmed.</p></figcaption></figure>
4. Optional: in **Sender domain DNS check**, press **Check domain**. Norbix looks up the **DKIM**, **SPF** and **DMARC** records of the sender address's domain and marks each one as found or **Not found**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-15ac0a1bde32dacac55f63a8f285d9e835d41b61%2Fintegrations-domain-health-1.png?alt=media" alt="Sender domain DNS check for acme.example: DKIM Not found, SPF Not found"><figcaption><p>The DNS check of a test domain: the records are missing.</p></figcaption></figure>

## Result

The badges at the top of the integration read **ENABLED**, **TESTED** and **CONFIRMED**, and the last test time is kept (**Last run: …**).

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-33d6eab3fa8d60214e773714795e8776f932ca5c%2Fintegrations-test-3.png?alt=media" alt="Editing SMTP integration with the badges ENABLED, TESTED, CONFIRMED"><figcaption><p>The badges after a passed and confirmed test.</p></figcaption></figure>

* **Test failed** shows the provider's answer, for example `Could not send email via Smtp. Received status: 503. Message: Failure sending mail.` Fix the settings, press **Save**, and test again.
* Missing DKIM, SPF or DMARC records do not block sending, but mailbox providers are much more likely to put the emails in spam. Add the records your provider gives you at your DNS host, then check again.

## Change or remove it later

* Test again at any time — for example after you rotate a key. A new test with a different recipient checks that delivery works outside your own mailbox.
* [Set as default](/codemash/cloud/emails/integrations/set-default.md) · [Disable or delete](/codemash/cloud/emails/integrations/disable.md).

## Do it from code

```ts
const integrationId = 'int_7bl0e6pSQmGzNFLp2P6rcd'; // Mailpit (local test)
const { items } = await norbix.hub.notifications.testEmailIntegration({ integrationId, to: 'ada.lovelace@example.com' });
console.log(items); // [ { operation: 'SendEmail', result: 'OK' } ]
await norbix.hub.notifications.confirmEmailIntegrationHumanDelivery({ integrationId }); // "I received it"
const health = await norbix.hub.notifications.checkEmailIntegrationDomainHealth({ integrationId });
// { domain: 'acme.example', items: [ { record: 'DKIM', value: '' }, { record: 'SPF', value: '' }, { record: 'DMARC', value: '' } ] }
```

```sh
norbix hub notifications email integration test --integrationId int_7bl0e6pSQmGzNFLp2P6rcd --to ada.lovelace@example.com
```

API: [Test Email Integration](/codemash/api-reference/notifications/email/test-email-integration.md) · [Confirm Human Delivery](/codemash/api-reference/notifications/email/confirm-email-integration-human-delivery.md) · [Domain Health](/codemash/api-reference/notifications/email/check-email-integration-domain-health.md)
