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 Settings → Cursor 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 Domains → Integration → API. 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.
Wrapping it up
We hope you enjoyed reading about sending emails using Cursor and Mailtrap MCP server. This article was originally published on the Mailtrap Blog, where you can find the full version along with many other helpful resources.
Top comments (0)