Coder Social home page Coder Social logo

fake-smtp-server's Introduction

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.

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": "[email protected]",
          "name": "Bob"
        }
      ],
      "html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Bob</span> &lt;<a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a>&gt;</span>",
      "text": "Bob <[email protected]>"
    },
    "from": {
      "value": [
        {
          "address": "[email protected]",
          "name": "Joe"
        }
      ],
      "html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Joe</span> &lt;<a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a>&gt;</span>",
      "text": "Joe <[email protected]>"
    },
    "messageId": "<1433879119.43.1505751136615@[10.143.108.87]>",
    "html": false
  }
]

You can filter emails with the following parameters:

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

Example:

    GET http://localhost:1080/api/[email protected]&[email protected]&since=2017-09-18T12:00:00Z&until=2017-09-19T00:00:00Z

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

Install

  npm install -g fake-smtp-server

Usage

Usage:
  fake-smtp-server [OPTIONS] [ARGS]

Options: 
  -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

fake-smtp-server's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.