MailDev v0.6.0

SMTP Server + Web Interface for viewing and testing emails during development.

Fork me on Github

MailDev is a simple way to test your projects' emails during development with an easy to use web interface that runs on your machine.

Features

  • Toggle between HTML, plain text views as well as view email headers
  • Test Responsive Emails w/ resizeable preview pane available for 320/480/600px screen sizes
  • Receive and view email attachments
  • New emails appear instantly in interface when received (via Websockets)
  • Command line interface for configuring SMTP and Web interface ports
  • Build on Node.js & hosted on NPM
  • Ability to relay email to an upstream SMTP server

Requirements - Node.js

Install & Run

Use npm to download and install MailDev or just grab the source off GitHub

  $ npm install -g maildev

Run the app

  $ maildev

Usage

On the command line:

  maildev [options]

    -h, --help              output usage information
    -V, --version           output the version number
    -s, --smtp [port]       SMTP port to catch emails [1025]
    -w, --web [port]        Port to run the Web GUI [1080]
    --outgoing-host   SMTP host for outgoing emails
    --outgoing-port   SMTP port for outgoing emails
    --outgoing-user   SMTP user for outgoing emails
    --outgoing-pass   SMTP password for outgoing emails
    --outgoing-secure       Use SMTP SSL for outgoing emails
    -o, --open              Open the Web GUI after startup
    -v, --verbose

Or in your Node.js project:

  var MailDev = require('maildev');

  var maildev = new MailDev();

  // Handle new emails as they come in
  maildev.on('new', function(email){
    console.log('Received new email with subject: %s', email.subject);
  });

  // Get all emails
  maildev.getAllEmail(function(err, emails){
    if (err) return console.log(err);
    console.log('There are %s emails', emails.length);
  });

Configure your project

Configure your application to send emails via port 1025 and open localhost:1080.

Example Setups

  • Node — Nodemailer:
      var transport = nodemailer.createTransport({
        port: 1025,
        ignoreTLS: true,
        // other settings...
      });
    
  • Django — add EMAIL_PORT = 1025 in your settings file [source]
  • Rails — add the port to your config settings:
      config.action_mailer.delivery_method = :smtp
        config.action_mailer.smtp_settings = {
          :address => "localhost",
          :port => 1025
        }
    

Ideas, Issues or Contributions?

Have an idea or feature request? I would love to here it. Create an issue on github or contact me on twitter @djfarrelly

Changelog

0.6.0 - Add relay option to send outgoing emails. Refactor for new API.

0.5.1 - Fix menu layout issue in Safari/Webkit

0.5.0 - Add command line interface. Web UI redesign.

0.4.0 - Add ability to receive and view attachments

0.3.1 - Added Socket.io to notify interface of new email

0.3.0 - Initial open source release

Thanks

Thanks to Andris Reinman for creating his projects that are the backbone of this app and MailCatcher for the inspiration.

License

MailDev is released under the MIT license