Bolt.new

Bolt.newarrow-up-right 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.

Before we start:

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 tokenarrow-up-right, 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:

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 documentationarrow-up-right, 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:

And here it is in the Mailtrap Email Logsarrow-up-right:

Next steps

Last updated

Was this helpful?