node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »


Fake STMP Server

Fake SMTP Server is an email testing tool for QA & development teams. It allows manual testing in a web interface, and automated testing via an API.


Listing all received emails

Received mails are listed on http://localhost:1080/api/emails, and looks like this:

    "attachments": [],
    "headers": {},
    "text": "Hi Bob!",
    "textAsHtml": "<p>Hi Bob!</p>",
    "subject": "Hi",
    "date": "2017-09-18T16:12:16.000Z",
    "to": {
      "value": [
          "address": "",
          "name": "Bob"
      "html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Bob</span> &lt;<a href=\"\" class=\"mp_address_email\"></a>&gt;</span>",
      "text": "Bob <>"
    "from": {
      "value": [
          "address": "",
          "name": "Joe"
      "html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Joe</span> &lt;<a href=\"\" class=\"mp_address_email\"></a>&gt;</span>",
      "text": "Joe <>"
    "messageId": "<1433879119.43.1505751136615@[]>",
    "html": false

You can filter emails with the following parameters:

  • from: filter sender
  • to: filter recipient
  • since: filter email date
  • until: filter email date


    GET http://localhost:1080/api/emails?

Removing all received email

To remove all emails without restarting the server:

    DELETE http://localhost:1080/api/emails

Web interface

Go to http://localhost:1080


  npm install -g fake-smtp-server


  fake-smtp-server [OPTIONS] [ARGS]

  -s, --smtp-port [NUMBER] SMTP port to listen on (Default is 1025)
  -h, --http-port [NUMBER] HTTP port to listen on (Default is 1080)
  -w, --whitelist STRING Only accept e-mails from these adresses. 
                         Accepts multiple e-mails comma-separated.
  -m, --max [NUMBER]     Max number of e-mails to keep (Default is 10)
  -a, --auth [String]    Authentication details in USERNAME:PASSWORD format