Future of AIAI

How to Send Emails From AI Assistants with Mailtrap

Imagine generating a superb project in a low-code platform like v0 and being able to add email-sending functionality all in one prompt. Or, forwarding that phenomenal email Claude has generated for you in less than 10 seconds.

Both of these scenarios are possible thanks to Mailtrap, a high-deliverability email platform that’s easy to integrate with low-coding tools and AI assistants alike!

In this article, I’ll show you how to send emails from v0, Windsurf, and Claude. The best part? It takes as much time as it does to boil an egg! 

Before we begin:

  • Make sure to have an active Mailtrap account with a verified sending domain.
  • Don’t forget to add admin access to your API key and store it safely.

Send emails from v0

To start sending emails from v0, all you need to do use a prompt like this one:

connect my project with mailtrap so i can send emails. to connect mailtrap and send emails, I’ll use my mailtrap email and mailtrap API key

Faster than you can say Cheese, v0 will ask you to complete three steps and add your Mailtrap credentials, such as your Mailtrap API key, ‘from’ email, and ‘to’ email (optional). For instance:

Once you add your credentials, you’ll be able to send emails from your project. It’s as simple as that!

Pro tip: Any emails you send via v0 this way, you’ll be able to see in Mailtrap Email Logs, where you can find additional details on your message, such as event history, spam analysis, and more. If you need further assistance, you can refer to step-by-step guide on how to send emails with v0.

Send emails from Windsurf

For Windsurf, we’ll use Mailtrap’s very own MCP server, for which you’ll need the latest Node.js version to use.

Once you install Node.js, simply open Windsurf, click on Settings, and then on Windsurf Settings.

On the Windsurf Settings page, click on the Manage MCPs button, which will then redirect you to the mcp.config.json file, where the magic happens.

In the mcp.config.json file, copy/paste the following script:

{

  “mcpServers”: {

    “mailtrap”: {

      “command”: “npx”,

      “args”: [“-y”, “mcp-mailtrap”],

      “env”: {

        “MAILTRAP_API_TOKEN”: “your_mailtrap_api_token”,

        “DEFAULT_FROM_EMAIL”: “[email protected]

      }

    }

  }

}

Finally, replace the following values from the script:

  • MAILTRAP_API_TOKEN → Enter your actual Mailtrap API key here.
  • DEFAULT_FROM_EMAIL → Insert an email with the domain you verified with Mailtrap.

Save the configuration, reload Windsurf, and voila, you’re all ready to start sending emails!

Just use a prompt like this one, modify it according to your liking, and hit enter:

Send an email to [email protected] with the subject ‘Hi John!’ and a message that wishes John a great day.

Send emails from Claude

Sending emails from Claude is quite similar to sending them from Windsurf, since we’ll use Mailtrap’s MCP server again and install the latest version of Node.js.

To configure Claude with Mailtrap’s MCP server, go to Claude settings and navigate to the Developer tab. Once there, you need to click on Edit Config, which should open the claude_desktop_config.json file.

Note: You can also find the configuration file in these two locations:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Once you open claude_desktop_config.json, copy/paste the following script:

{

  “mcpServers”: {

    “mailtrap”: {

      “command”: “npx”,

      “args”: [“-y”, “mcp-mailtrap”],

      “env”: {

        “MAILTRAP_API_TOKEN”: “your_mailtrap_api_token”,

        “DEFAULT_FROM_EMAIL”: “[email protected]

      }

    }

  }

}

As with Windsurf, replace MAILTRAP_API_TOKEN and DEFAULT_FROM_EMAIL with your actual Mailtrap credentials.

Then, open a new chat with Claude and specify Mailtrap MCP you just added.

And to send an email, you can use any prompt that comes to mind. For instance:

Send an email to my dear friend Mike at [email protected] and ask him how he’s doing. Make sure to format it properly and write it in a relaxed tone.

Claude will then generate an email, forward it to Mike, and provide you with all the details regarding the message it sent. As simple as 1, 2, and 3!

Wrapping up

With that, we wrap up our guide on sending emails from AI assistants using Mailtrap!

It’s a really straightforward solution that allows for easy integration, plus, it has a generous free plan that lets you send up to 3,500 emails per month, so be sure to check it out!

Author

Related Articles

Back to top button