> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/guides/ai-powered-integrations/bolt-new.md).

# Bolt.new

Step-by-step guide to integrate Mailtrap with Bolt.new to send transactional emails and manage contacts using AI-powered development.

[Bolt.new](https://bolt.new/) is an AI-powered builder that lets you generate and scale high-performing websites and apps using prompts. In this article, you’ll learn how to connect it to Mailtrap and add email-sending functionality to your projects.

**Note**: Mailtrap offers a free, 4000 email/month Email API and SMTP plan.

**Before we start**:

* Add and [verify your email sending domain](https://docs.mailtrap.io/email-api-smtp/setup/sending-domain) since Mailtrap allows you to send emails only from a verified domain.
* Make sure your [API Token](https://docs.mailtrap.io/email-api-smtp/setup/api-tokens) has `admin` access level to that domain.

### Step 1. Add your Mailtrap credentials

Open your Bolt.new project and add your:

* `MAILTRAP_FROM_EMAIL` – This is the email address with the verified Mailtrap sending domain you’ve added after creating an account.
* `MAILTRAP_API_TOKEN` – This is the [Mailtrap API token](https://docs.mailtrap.io/email-api-smtp/setup/api-tokens), which you can create at any time from your account.

To do this, click on **More Options** (usually located above your project) and then on **Secrets**, and add the following two values:

<figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FsIBC538FQnCJ8xqdBIFs%2Fbolt%201.png?alt=media&amp;token=a0a13ebc-9970-4034-bf77-444c9be90741" alt=""><figcaption></figcaption></figure>

Next, prompt the AI to use the secrets you just added so it can start sending emails from your projects using the Mailtrap email API. For this, you can use a prompt like this one:

> Please use Mailtrap email API for sending emails from my project. I’ve added the following secrets: MAILTRAP\_FROM\_EMAIL and MAILTRAP\_API\_TOKEN

The AI will then go over [Mailtrap Email API documentation](https://docs.mailtrap.io/developers), connect it to your project, and confirm once it’s done.

### Step 2. Start sending emails

Once you add your credentials, try sending an email from your project. If you followed everything thus far, you should receive the email in your inbox in a few seconds.

Here is the email in a Gmail inbox I used as my `to` address:

<figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FRJt4iXPLy2ZpGWLzCYwu%2Fbolt%202.png?alt=media&amp;token=c2b01a28-4a69-42dc-91f2-9b8b7865d76e" alt=""><figcaption></figcaption></figure>

And here it is in the [Mailtrap Email Logs](https://docs.mailtrap.io/email-api-smtp/analytics/logs):

<figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2Fzv5LJjHmS6tDVSqwh1o7%2Fbolt%20.png?alt=media&amp;token=89c8f91a-85d4-4292-bcce-a288c95a7131" alt=""><figcaption></figcaption></figure>

### Next steps

* Use [Mailtrap Templates](https://docs.mailtrap.io/email-marketing/campaigns/email-templates) to send branded emails with variables.
* Configure [Mailtrap Contacts](https://mailtrap.io/mailtrap-contacts/) to push user information to your Mailtrap Lists, so you can later send campaigns to them or use Automations.
* [Add automation triggers](https://docs.mailtrap.io/email-marketing/automations) in Mailtrap to send follow-ups to new contacts.
* Track open and click rates with [Mailtrap Analytics](https://mailtrap.io/actionable-analytics/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mailtrap.io/guides/ai-powered-integrations/bolt-new.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
