Setting up a MailTrap Account for Email Testing

Setting up a MailTrap Account for Email Testing

  • Mailtrap.io is an "email sandbox" environment. 
  • Capture SMTP traffic from staging and dev environments.
  • Automate test flows and scenarios with flexible API.
  • Analyze email content for spam score and validate HTML/CSS.
  • Powerful Automation For Testing Your Email Sequences.

Getting Started Guide

You need to create a Mailtrap Account first, click here

Mailtrap Email Delivery Platform is an end-to-end solution to Test, Send, and Control your emails. 

Email Sandbox (Testing emails)

Use Email Sandbox for secure email testing. Catch testing emails from staging. Preview and analyze content for spam and validate HTML/CSS before sending emails to recipients’ inboxes. 

Tip: By default, we created an inbox for you and called it "My Inbox" (It’s under the My Inboxes project). The Edit button allows you to rename either a project or an inbox.

Email API (Sending emails)

Use Email API/SMTP to send emails to recipients’ inboxes on production. Mailtrap also gives you more control over email deliverability. For further information check:

  1. Mailtrap Email API page
  2. Sending Domain Setup

Now, we're ready to welcome you as a Mailtrap user!

As mentioned, use Mailtrap Sandbox to safely test your emails in staging, then move to production with our Email API.

This guide gives tips and tricks on getting started and making the best of Mailtrap Sandbox and Email API. 

Email Sandbox <Test>

How to send a test email to Mailtrap Sandbox

There are three ways to do it. 

Option 1. Paste a few lines of code to your app script

In the SMTP Settings tab, select a framework from the list of integrations, copy the code sample, and then paste it into your email-sending script. 

The sample contains the Mailtrap hostname, port number,  username and password. 

Important Notes:

  • Each Mailtrap inbox has its SMTP/POP3 server credentials and you can reset them anytime. 
  • Username and password are unique for each inbox. For your security, please avoid sharing them publicly. 
  • You access SMTP settings by clicking the gear icon on the far right of the “My Inbox” menu or the inbox name, as shown below. 

Option 2. Paste SMTP credentials to your app script, MTA, etc.  

In the  SMTP Settings tab, click the Show credentials link. 
Or you can select the INTEGRATION as " nodemailer" and get your username and password from there.
Copy SMTP credentials:
  •  Username: unique for each inbox
  •  Password: unique for each inbox 

VERY IMPORTANT: When creating a Mailtrap email provider, you only need the username and password, Paste the credentials to your email-sending script. (SwitchTransact also does not use POP3, only SMTP)

When you create a MailTrap Email Provider, the API Key and API Secret are the MailTrap username and password (API Key: username, API Secret: password)


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.