---
title: "Test email, MailKaro Docs"
description: "Test email in MailKaro: send yourself a test before you launch. For React, Vue, Angular and plain JavaScript."
---

# Test email

Deliverability

# Test email

Send yourself a test before you launch.

Render the design and send it to your own address via the [send endpoint](https://mailkaro.com/docs/cloud-api) (SMTP or your provider):

bash

```
curl -X POST https://api.mailkaro.com/v3/emails \
 -H "Authorization: Bearer sk_live_…" \
 -H "content-type: application/json" \
 -d '{ "design": {…}, "to": "you@example.com", "subject": "Test" }'
```

## A button in the editor

Give the editor a `sendTestEmail` function and the toolbar gets a "Send a test email" button. It opens a small form (address, subject), calls your function with the rendered HTML, and shows "Sent to ..." or the message of any error you throw. The editor never holds a key or an address to send from: your function runs on your side, so call your own backend, which calls `POST /v3/emails` with a server key. The address is remembered in the browser, and the HTML includes the merge tag preview values and the language chosen in Preview.

tsx

```
<EmailEditor
 config={{
 sendTestEmail: async ({ html, subject, to }) => {
 const res = await fetch("/api/test-email", {
 method: "POST",
 headers: { "Content-Type": "application/json" },
 body: JSON.stringify({ html, subject, to })
 });
 if (!res.ok) throw new Error("We could not send the test email.");
 }
 }}
/>
```

Hide the button with `ui.toolbar.sendTestEmail: false`. A plan that restricts the toolbar to an allowed list (`allowed_toolbar_actions`) also hides it unless `send_test_email` is in that list.

Source: https://docs.mailkaro.com/test-email
