Last updated: August 17th, 2020
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. With Mailtrap, you will never spam real customers or flood 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 email campaigns.
In this post, we will share how to quickly and easily set up your account, as well as guide you through the testing process.
Let’s go through the basic steps first and then dive deeper into all of Mailtrap’s 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 the four easy steps described below. Once you’ve logged in to your account, you will be on the 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:
- host: smtp.mailtrap.io
- port: 25 or 465 or 587 or 2525
- username: unique for each inbox
- password: unique for each inbox
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:
Options for 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: Paste the credentials/configuration to your email script in the development environment and send your first test message.
STEP #4: Go back to your inbox and see that the message sent by your application is immediately caught and appears there:
Emails 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 whether your application is sending emails correctly. Or most likely, you would like to review how your messages display and perform. Mailtrap offers multiple helpful options for email content verification and debugging.
The HTML tab demonstrates how your message would 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 a desktop, tablet or smartphone. Use the icons in the HTML tab to perform these checks.
Preview your message in Mailtrap
To view the HTML markup, check out the HTML Source tab.
Additionally, you can view the plain text of your message in the Text tab, and the raw email data (as received from the SMTP relay) in the Raw tab. If the raw data exceeds 300 KB, you will be prompted to download it as a .eml file.
You can access all of these views from the message tabs, or open them in a new tab from the Message menu under the three dots in the top-right corner.
Choose from three different views
In the Check HTML tab, you will find a list of HTML/CSS properties, which may cause issues with rendering your message in specific email clients:
Analysis is another important feature. In this tab, Mailtrap offers spam check results and provides recommendations on how to decrease the message’s spam score if any issues were found. In the same tab you will also find a Blacklists Report. Mailtrap checks whether your IP or domain has been listed on any of the commonly used blacklists. It shows resources which have been queried:
Tip: Don’t forget to check the email headers and attachments. They are not just an important part of content, but also affect the spam score.
The basic functionality described above is absolutely free. For larger teams, Mailtrap offers additional awesome features, included in the paid billing plans. Below you will find 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.
Your inbox is already a part of a Project (“My Inboxes”, by default). To customize it, go to your Mailtrap home page and use the three-dots menu next to the Project name. Also, you can delete project 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.
Mailtrap allows you to share your inboxes with other users, as well as invite new members to collaborate within a project.
Let’s go back to the Inbox Settings. To invite your teammates (or anyone you wish) to work together on debugging your emails, switch to the Team Members tab. Enter an email address and this user will gain full access to your inbox and all the messages within (after confirming your request by email). If this address is not yet registered in Mailtrap, its owner will first be asked to create a free account.
Invite Team Members to your Inbox
Invite Team Members to your Mailtrap project
Your team members will find this inbox in the Shared Inboxes section on the home page. To share all inboxes grouped in the project, click the Project Team Members link in the Team Members tab. There you can enter email addresses to send the invitation by email, or get a 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 your Mailtrap project
Otherwise, you can go to your home page and select the Team Members option from the three-dots menu next to the Project name.
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. In the Manual Forward tab, enter the email address where you wish to send your message, and press Add Email:
After that, the selected email recipient will get a request to confirm receipt of 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 clicking the Forward email icon in the message menu.
To improve your user experience and expand collaboration options, Mailtrap allows you to automatically forward all caught messages to the real email addresses and domains. 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 held in this inbox will be automatically forwarded according to the specified rules.
Tip: The number of emails you can forward depends on your current billing plan.
Your inbox also has an email address where you can send messages. It can be enabled in the Email Address tab:
You can use it with your email sending provider without a need to integrate Mailtrap. The email address contains a customizable alias. In addition, it supports dynamic aliases (name+1) so that you can create an almost infinite list of addresses to imitate sending to multiple users.
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.
You will see the detailed list of email addresses used in this message (in MAIL and RCPT TO commands) in the Tech info tab:
To get details on billing plans, follow this link or press the Upgrade button in your account.
You can also access Mailtrap’s functionality by using its API. Go to your account menu on the Home page, and select 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 the core resources that are used to manipulate the main entities.
If you have any questions, feel free to contact us at email@example.com.
And you are more than welcome to follow us on Facebook and Twitter. We are happy that you joined Mailtrap, the community of 500,000+ developers, QAs, and managers who use it for safe and easy email testing.
Need help with email sending set up for your infrastructure? Find your guide here:
- Sending Emails with PHP
- Sending Emails with PHPMailer
- Sending Emails with Laravel
- Sending Emails with Symfony
- Sending Emails with NodeJS
- Sending Emails with Nodemailer
- Sending Emails with Java
- Sending Emails with Python
- Sending Emails with Django
- Sending Emails with Go
- Sending Emails with Ruby
- Sending Emails with ASP .Net C#
- Sending Emails from Angular App
- Sending Emails from React App
- Sending Emails from React Native App