After a long time using Gmail SMTP as my main service for sending email in development environment. I switched to Mailtrap and Mandrill for some recent projects. This post will introduce my experiment when working with these two awesome mailing services.
Mailtrap is a fake SMTP server for development teams to test, view and share emails sent from the development and staging environments without spamming real customers.
As its slogan, Mailtrap focuses to non-production environment. It “traps” all email sending services from your application and display these email in a virtual inbox. You can preview all your sent emails without caring about the recipient addresses exist or not. If you use real email addresses (in staging server for example), there will be no real email sent to them, too, which means there is no spam to your customers.
You can create many inbox and use different inbox in different enviroments. However, the free plan of Mailtrap support only one, and a maximum of 50 emails inside the inbox. When this inbox is full, you can continue trapping your emails by clear all old ones.
You can see many useful information about each email inside the inbox via detail panel:
- The address of sender and recipient as well as the sending time
- The rendered HTML email, HTML source
- The text email if available
- The spam analysis to make sure your email is not recognized at spam by other machines
- The result of email HTML validation in many email clients
Mandrill is a reliable, scalable, and secure delivery API for transactional emails from websites and applications. It’s ideal for sending data-driven transactional emails, including targeted e-commerce and personalized one-to-one messages.
Different from Mailtrap, Mandrill is a service allowing sending real email even in production environment. To prevent your customer from receiving testing email when develop your application, you can switch to test mode of your Mandrill account. In this mode, Mandrill works like Mailtrap: not sending any emails, just show them in its reports with the email content.
You can see basic information about your email inside the Outbound report of Mandrill:
- Email sender, recipient and delivering time
- Email subject
- Email content: HTML and text (via another popup window)
|Use in production||No||Yes|
|Trapping emails||Yes (default)||Yes (After turn test mode on)|
|Support SMTP||Yes||Yes (real mode only)|
|Support REST api||Yes||Yes (required when using test mode)|
|Separate emails in environments||By sending email to different virtual inbox||By adding tags into STMP headers or REST payload|
|Refresh time||Instant||With a little delay|
My favorite one
I cannot tell you which service is better. Each one has its own pros and cons. In my personal project, I use Mandrill for production environment because it awesome delivery feature. In development servers, I use Mailtrap to analyze my emails and preview the result quickly. I hope that after reading my reviews, you can have another inspiration for sending emails in your application.