Mailtrap Getting Started Guide

Last updated on August 29, 2019

Welcome to Mailtrap

We are happy to welcome you as a Mailtrap user! Mailtrap is a tool for the safe testing of emails sent from the development and staging environments, without spamming real customers or flooding your own and team members inboxes. It is a fake SMTP server designed to catch your test emails. Mailtrap emulates the process of sending, so we won’t deliver your emails to a real user. Mailtrap keeps your emails in a virtual inbox so that you can test and optimize your HTML email campaigns.

In this post, we will share how to set up your account, easy and fast, as well as guide you through the testing process.

Let’s go through the basic steps first and then dive deeper into all Mailtrap features.

First steps with the basic Mailtrap functionality

All you need to do is just set Mailtrap as an SMTP server for your application, following four easy steps described below. Once you’ve logged in to your account, you will get to the home page:

Mailtrap Home Page
Your Mailtrap home page

STEP #1: Open your inbox: click on the Demo Inbox or on the Settings icon in the Action section.

Tip: We have already created an inbox for you. By default, it’s “Demo inbox”. You can easily rename it with the Edit action button or Delete it and create a new one. It’s your choice.

STEP #2: Copy SMTP credentials and embed them into your development environment:

SMTP Settings Mailtrap
SMTP Settings

Mailtrap offers an extensive list of integrations, including Ruby, Python, PHP, Node.js, Java, Scala and C# modules and frameworks. Choose your preferred option to see an example of how to integrate Mailtrap into your application:

Mailtrap Options for Easy Integration with Your App
Options for the easy integration with your app

Tip: each Mailtrap inbox has its own SMTP/POP3 server credentials. You can reset them any time you need.

STEP #3: Configure your development environment with appropriate Mailtrap settings and send your first test message.

Dev Configuration with Mailtrap
Dev configuration with Mailtrap

STEP #4: Go back to your inbox and see that message sent by your application is immediately caught and appears there:

Mailtrap Email Trapped in the Inbox
Email trapped in the Mailtrap inbox

This way, you have verified that email sending and retrieving are both functioning properly. It’s perfectly simple, isn’t it? Besides, other Mailtrap users can share their inboxes with you. If they do, you will find them in the Shared Inboxes section of the main menu. 

Tip: You can also share your inbox with anyone, but this option is available for advanced users. Go to the “Premium Perks” section below to get more details.

What else can you do with Mailtrap?

Perhaps, you need to quickly check if your application is sending emails correctly. But most probably, you would like to review how your message displays and performs. Mailtrap offers multiple helpful options for email content verification and debugging. HTML tab demonstrates how your message might look in the recipient’s mail client. In fact, it shows how the email is rendered by a web browser. You can also open your message in a new tab as well as view how it would be displayed on desktop, tablet or smartphone.

Preview your message in Mailtrap - HTML tab
Preview your message in Mailtrap

The HTML Source tab provides you with the HTML markup:

View the HTML source code in Mailtrap
View the HTML source code

Go to the Check HTML tab to find a list of HTML/CSS properties, which might cause issues with rendering your message in specific email clients:

Validate HTML and CSS in Mailtrap
Validate HTML and CSS

The Text tab shows the plain text of your message:

View the plain text of your HTML email in Mailtrap
View the plain text of your HTML email

In the Raw tab you can review the raw email data, as received from the SMTP relay. If the raw data exceeds 300 KB, you will be given the option to download it as .eml file.

Check the raw message data in Mailtrap
Check the raw message data

Analysis is another important and highly demanded feature. In this tab Mailtrap offers spam check results and provides recommendations on how to decrease spam score, if any issues were found.

Spam check in Mailtrap
Spam report

In the same tab you will also find a Blacklists Report: Mailtrap checks whether your IP or domain has been listed in any of the commonly used blacklists. It shows resources which have been queried:

Mailtrap Blacklists Report
Blacklists report

Tip: Don’t forget to check the email headers and attachments. They act not as just an important part of content but also affect the spam score.

Premium perks

The basic functionality described above is absolutely free. For bigger teams, Mailtrap offers additional awesome features, included in the paid billing plans. Below are some useful tips on using them.

Carefully organized data

To keep everything in order and be able to easily find or share necessary data, set up a new inbox for each test server, and then group them into Projects.

Projects in Mailtrap
Projects in Mailtrap

Your inbox is already a part of a Project (“My Inboxes”, by default). To customize it, go to your Mailtrap home page. Press the Edit icon to rename your project. Also, you can delete it by pressing the Delete icon, and then create a New Project. Keep in mind that if you delete your project, all inboxes inside it will be removed too.

Collaboration options

Mailtrap lets you to share your inboxes with other users as well as invite new members to collaborate within a whole project.

Let’s go back to the Inbox Settings. To invite your teammates (or anyone you wish, actually) to work together on debugging your emails, switch to the Team Members tab. Just enter an email address and this user will get full access to your inbox and all the messages. If this address is not registered in Mailtrap yet, its owner will be offered to create a free account first.

Invite Team Members to Inbox in Mailtrap
Invite Team Members to your Inbox

Further, your team member will find this inbox in the Shared Inboxes section of the main menu. To share all inboxes grouped in the project, press the Project Team Members link in the Team Members tab. There you can enter the email address to send the invitation by email or get the shareable link.

In the same tab, you also can review and edit the list of the Project Team Members as well as monitor their status (pending, user, or owner).

Invite team members to the Mailtrap project
Invite Team Members to our project in Mailtrap

Otherwise, you can go to your home page and press the Project Team Members icon next to the Project name.

To learn more about the Team Members feature and sharing options, check this post.

Viewing emails in the real inboxes

If you need to check how your message will be displayed in a particular email client, or your customer asks you to demonstrate the results of your work, you can forward any message to a real user’s inbox, manually or automatically.

Please note that verification is needed to prevent Mailtrap usage for spam and fraud!

To forward a particular message from your inbox, go to the Inbox Settings and in the Manual Forward tab enter the email address where you wish to send your message, and press Add Email:

Manual Email Forwarding in Mailtrap
Manual email forwarding in Mailtrap

After that, the selected email recipient will get a request to confirm receiving your forwarded messages. If agreed, this email address will appear in the “Manual Forwarded Emails” list.

Now you can choose any email from your inbox and forward it to the confirmed email address by pressing Forward email icon in the message menu:

Mailtrap Email Forwarding in the Message Menu
Forward an email from the message menu

To improve your user experience and expand collaboration options, Mailtrap allows you to forward all caught messages to the real email addresses and domains automatically. In the Auto Forward tab, you can create a list of rules for automatic forwarding. Select “Email” or “Domain”, enter an email address or domain value, then click on the Add Rule button. Once those emails and/or domains are verified, all messages trapped into this inbox will be automatically forwarded according to the specified rules.

Automatic forwarding in Mailtrap

Tip: The number of forwarding rules you can create for one inbox depends on the billing plan you currently use.

Moreover, your inbox has an email address where you can send messages. It can be enabled in the Email Address tab:

Inbox Email Address in Mailtrap
Unique email address for your inbox

Email addresses in Bcc

You can easily test and debug Bcc email addresses with Mailtrap. If the message you sent to Mailtrap contains Bcc’ed recipients, you will be able to see them along with the message headers (From, To, Cc). Bcc won’t be displayed in a real email! Mailtrap analyzes SMTP commands of the message, compares message headers and recipients, and then prints out the difference to the Bcc field for your convenience. 

Email address in Bcc in Mailtrap
Email address in Bcc

Also, you can see the detailed list of email addresses used in this message (in MAIL and RCPT TO commands) in the SMTP info tab:

SMTP info in Mailtrap

To learn more about Bcc, its mechanism, implementation and use cases in Mailtrap, check this post.

To get details on billing plans, follow this link or press the Upgrade button in your account.

Use Mailtrap API

You can also access Mailtrap’s functionality by using its API. Go to your account menu on the Home page, and select API from the drop-down list:

Mailtrap's API Access
Integrate Mailtrap via API

There you will get your API token, link to API Docs and will be able to specify a list of domains, which will have access to API by CORS.

The Mailtrap API uses REST protocol and can return calls in JSON or XML data formats.

To get more information and examples, go to Mailtrap API Documentation. It covers core resources that are used to manipulate the main entities.

Start Testing Now!

More about Mailtrap

Still have some questions about Mailtrap? Check out the FAQ section. You can always go back to it from your account menu.

Mailtrap's FAQ
Mailtrap’s FAQ

You are more than welcome to join the Mailtrap community! Feel free to submit your ideas and feature requests here (press Help in the main menu of website); follow us on Facebook and Twitter to stay tuned!


Need help with email sending set up for your infrastructure? Find your guide here: