Anything
Anything is an AI agent that can turn your ideas into sites, apps, tools, products, and more with simple prompts. In this article, you’ll learn how to connect it to Mailtrap and add email-sending functionality to your projects.
Prerequisites:
Add and verify your email sending domain since Mailtrap allows you to send emails only from a verified domain.
Make sure your API Token has admin access level to that domain.
Step 1. Add your Mailtrap credentials
To add your Mailtrap credentials, open Project Settings in the sidebar, navigate to Secrets, and click on the Add new secret button.

This way, you need to add the following two secrets:
MAILTRAP_API_TOKEN
This is the Mailtrap API token, which you can create at any time from your account. And here’s what the secret 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 secret:

Once you’re done adding the secrets, simply tell the Anything AI that you’re done with a prompt like this one, for example:
Please use Mailtrap email API for sending emails from my project, I've added the MAILTRAP_API_TOKEN and MAILTRAP_FROM_EMAIL secrets
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
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 it is in a Gmail inbox I used as my to address:

And here it is in the Mailtrap Email Logs:

If you plan on collecting email addresses for a list, you can connect your Anything project with Mailtrap Contacts and store your addresses in your Mailtrap account automatically. For reference, check out the official Mailtrap Contacts API documentation.
Next steps
Use Mailtrap Templates to send branded emails with variables.
Configure Mailtrap Contacts to push user information to your Mailtrap Lists, so you can later send campaigns to them or use Automations.
Add automation triggers in Mailtrap to send follow-ups to new contacts.
Track open and click rates with Mailtrap Analytics.
Last updated
Was this helpful?

