Django emailing testing workflow

Intro

One of the routines that a web developer deal with almost in every new project is sending emails ( account verification, newsletters etc …). Here comes a wonderful solution called mailcatcher. Our story is about how to setup mailcatcher and configure Django to use it for a better workflow without wasting time with other solutions or using your gmail account credential during the development of your new project.

Mailcatcher provides you with a local SMTP server for sending and catching emails sent by your web application. Then, you can display it in a clean and simple web interface.

Installation and execution

Mailcatcher is available as a ruby gem, and can be installed with one command line :

sudo gem install mailcatcher

Now its installed and ready to use, you can run it in your terminal :

☁ ~ mailcatcher

Starting MailCatcher

==> smtp://127.0.0.1:1025

==> http://127.0.0.1:1080

*** MailCatcher runs as a daemon by default. Go to the web interface to quit.

You can reach it though your browser by opening http://localhost:1080/

Configuring with Django

Configuring mailcatcher with django is so easy, all you need to do is opening your settings.py and add those line:

EMAIL_HOST = ‘127.0.0.1'

EMAIL_PORT = 1025

Happy email testing.