Email SMTP for Development / QA Environment

By Jimmy Bonney | September 4, 2012

Email

Developing web applications often requires emails to be sent out, whether it is during the registration process, for newsletters or for some events notifications.

When the application is live, there are plenty of options to send the email:

  • simple sendmail application
  • connection to a SMTP server
  • connection to a SMTP application (web application allowing to track emails that have been sent)

However, when one uses any of this option in a development environment, the inbox might become quickly spammed with test emails. Even worse if using a QA environment that has production data, there is a risk that some emails are actually sent to the original user by mistake. Not the best move towards your customers…

So what are the options in a development or QA environment? Most development environments allow to simulate emails being sent. The emails will appear in the logs but nothing is actually sent out. This is a great option, until one is interested in testing the emails and see how they look for instance.

This is where Mailtrap comes to the rescue. It allows to simply redirect all emails to a hosted SMTP server. All emails can then be viewed from within the application. If you wish to do so, access to the folder can be shared so that all your team can access the emails. No more forwarding emails to highlight issues in the layout or content: everybody can see it directly from within the application.

Configuration is pretty easy too. Simply specify the SMTP server in your application configuration file. A lot of framework configurations (Ruby on Rails, Django, Symphony, Zend Framework, etc.) are provided as well to make the switch in just a minute.

Mailtrap configuration

Once everything is set up, you will see all the email sent from within the application interface. A nice addition gives you have the possibility to view your emails in a lot of different format (HTML, HTML source, Text and Raw).

Mailtrap interface

If the previous arguments were not enough to convince you, I should add that Mailtrap is completely free to use.



For the time being, comments are managed by Disqus, a third-party library. I will eventually replace it with another solution, but the timeline is unclear. Considering the amount of data being loaded, if you would like to view comments or post a comment, click on the button below. For more information about why you see this button, take a look at the following article.