Reflex Build
Reflex Build is an AI-powered development tool that enables you to create full-stack web apps, dashboards, and components through natural language prompts. In this guide, you’ll learn how to integrate it with Mailtrap and add email-sending capabilities to your Reflex projects.
Prerequisites:
A Reflex Build account and a project.
A Mailtrap account for sending emails.
Step 1. Add your Mailtrap credentials
To add your Mailtrap credentials, open Settings in the sidebar, navigate to Secrets, and click on the Add new variable button.

This way, you need to add the following two variables:
MAILTRAP_API_TOKEN
This is the Mailtrap API token, which you can create at any time in your account under Settings → API Tokens. And here’s what the variable should look like:

MAILTRAP_FROM_EMAIL
This is the email address with the verified Mailtrap sending domain you’ve added after creating an account. And here’s the variable:

Once you’re done adding the variables, simply tell the Reflex Build AI that you’re done with a prompt like this one, for example:
Please use Mailtrap email api for sending, I've added the required environment variables
The AI will then go over Mailtrap Email API documentation, connect it to your project, and confirm once it’s done.
Step 2. Start sending emails
Finally, to test your configuration, 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 it is in a Gmail inbox I used as my to address:

And here it is in the Mailtrap Email Logs:

Before you go: If you plan on collecting email addresses for a list, you can connect your Reflex Build project with Mailtrap Contacts and store your addresses in the Mailtrap Lists automatically. For reference, check out the official Mailtrap Contacts API documentation.
Last updated
Was this helpful?

