Join us

How to Send Emails in Claude Desktop with Mailtrap MCP

Ever since Mailtrap launched its very own MCP server, Claude can not only generate emails for you, but it can also send them to your recipients.

The integration is super seamless, takes ~5 minutes, and works for both Windows and macOS.

In this guide, I’ll show you how to integrate the Mailtrap MCP, and then we’ll send some emails.

Before we start:

  • Install the latest Node.js version since Mailtrap MCP is implemented as a Node.js command line utility.
  • If you haven’t already done so, install the Claude Desktop app. But if you have, make sure it’s updated and uses the latest version.

Setup Mailtrap MCP Server

First, open your Claude Desktop, navigate to Settings, and in the Developer tab, click on Edit Config

This will open the Claude directory containing the claude_desktop_config.json file. The file is used by Claude Desktop to store the users’ settings and the MCP servers to which you can make requests. We will use it to add a new configuration for Mailtrap MCP.

Tip: You can also open the claude_desktop_config.json file in the following locations:

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

Once you open the claude_desktop_config.json file (e.g., you can do it via any IDE of your choice; personally, I do it via VSC), copy-paste the code snippet below inside it: 

{
"mcpServers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com"
}
}
}
}

Then, to use Mailtrap API to send emails, open your Mailtrap account and navigate to Sending DomainsIntegrationAPI.

On the Integration/API page, update the following values in your mcp.json file with Mailtrap credentials:

  • MAILTRAP_API_TOKEN – Used to authenticate API requests, which you can copy/paste from the credentials tab.
  • DEFAULT_FROM_EMAIL – Make sure the email’s domain matches your own domain from the Sending Domains tab in Mailtrap.

Lastly, save the configuration with the updated values and reload Claude Desktop. After reloading, a mailtrap MCP should be present in the Developer Settings.

Send emails with Mailtrap Email MCP Server

To use the configured Mailtrap MCP for email sending, let’s open a new chat. 

In the opened window, make sure the MCP tool is specified. 

This will allow Claude Desktop to perform actions for us, for instance email sending using Mailtrap MCP and send-email.

Finally, to send a plain-text email, you can use a prompt like the one below, but you can also experiment with your own prompts:

If Claude asks you to verify the usage of Mailtrap MCP, click Allow for this chat

Then, it should successfully send a new email and provide you with the properties the email has been sent with in the response.

You can verify it by checking the Email Logs tab of your Mailtrap dashboard.

Send HTML email 

To send an HTML email in Claude Desktop using Mailtrap MCP, just modify the prompt to clearly state that we want our message to be formatted in HTML. For example:

As you send a new prompt, Claude Desktop will send a new email with the html field being specified, which contains the HTML content of our email.

A new HTML email should be sent successfully, which you can verify by checking the Preview tab in Mailtrap Email Logs and see how it looks.

Send email to multiple recipients

To send an email to multiple recipients, all you need to do is specify the addresses you want in the prompt. For instance:

As you send a new prompt, Claude Desktop will try to send a new email. In this case, we can see a new cc field being specified, which includes a list of additional recipients provided via carbon copy.

A new email should be sent to multiple recipients, which you can verify by checking the Email Logs tab in Mailtrap. 


Let's keep in touch!

Stay updated with my latest posts and news. I share insights, updates, and exclusive content.

By subscribing, you share your email with @idjuric660 and accept our Terms & Privacy. Unsubscribe anytime.

Give a Pawfive to this post!


Only registered users can post comments. Please, login or signup.

Start blogging about your favorite technologies, reach more readers and earn rewards!

Join other developers and claim your FAUN.dev account now!

Avatar

Ivan Djuric

Technical Content Writer, Mailtrap

@idjuric660
As a Technical Content Writer with 5 years of experience, I specialize in covering email-related topics, collaborating closely with software engineers and email marketers. My goal is to provide you with insights on email sending and testing.
Developer Influence
251

Influence

24k

Total Hits

31

Posts