Join us

How to Send Emails in Cursor with Mailtrap MCP Server

If you want to send emails in Cursor, you won’t be able to do it since it doesn’t have built-in sending functionality. But don’t worry—I’ve got you covered!

In this article, I’ll show you how to integrate Cursor with Mailtrap MCP and start sending emails with simple prompts—whether you’re on Windows or macOS.

Before we start: Since Mailtrap MCP server is implemented as a Node.js command line utility, make sure that besides the Cursor editor, you have the latest Node.js version installed.

Setup Mailtrap MCP Server

First, let’s set up and configure an MCP Server in Cursor. So, open your Cursor editor and navigate to SettingsCursor Settings.

Once in the Cursor Settings window, go to the MCP tab and click on Add new global MCP server.

This will open a new mcp.json file, which is used by Cursor to store all the MCP servers you can make requests to. Initially, the file is empty, so copy/paste the following configuration inside it:

This setup allows us to use Mailtrap Email API to send emails by prompting the AI within Cursor. However, now you need to replace MAILTRAP_API_TOKEN and DEFAULT_FROM_EMAIL values with your own Mailtrap API credentials. 

To do this, open your Mailtrap account and navigate to Sending DomainsIntegrationAPI. There, you’ll see:

  • Your domain name, which is different for every user. For example, with the domain used for this article, I can use something like ‘no-reply@freelance.mailtrap.link’.
  • The API token, used to authenticate API requests, which you can copy/paste.

After inserting the credentials in your mcp.json file and saving it, Mailtrap MCP should be successfully displayed as connected in the MCP tab of Cursor Settings.

Note: Although you shouldn’t have issues, we recommend reloading Cursor to make sure everything is set up correctly.

Send emails with Mailtrap MCP server

Now, let’s use the configured Mailtrap MCP to send some emails. 

First, toggle the AI Pane, located in the upper-right corner of the Cursor editor.

In the opened pane, make sure that the Agent mode is configured since it allows Cursor to perform actions for us.

To send a plain-text email, you can use a prompt like this one (although I encourage you to use your own prompts and experiment with them since the possibilities are pretty much endless):

Send an email to john.doe@example.com with the subject ‘Hi John!’ and a message that wishes John a great day.

Cursor will then identify the Mailtrap MCP server for your request, suggest running the right tool, in this case, send_email, and generate the email with all the parameters and values for you. As soon as you’re ready to send, click Run tool.

Lastly, Cursor AI will notify you when it successfully delivers the email.

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


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

30

Posts