A very, very simple to use SMTP server to accept incoming mail for node.js

npm install lazysmtp
12 downloads in the last month


Your new favorite module for receiving mail. And nothing more. Nothing less.

How to install

Run npm install lazysmtp, or alternatively clone this repo, or alternatively fork then clone, or alternatively view raw file, or alternatively hire an underpaid illegal worker to install it, or alternatively party hard.

WARNING: Partying hard might not lead to expected results, including but not limited to lazysmtp not working and noise complaints from your neighbors)

How to use

Mail(host, debug)

  • host: Host for the server. (e.g., "localhost", "")
  • debug: Boolean for outputting debug logs to stdout.

Instantiate a new Mail class. Has one method that allows you to start the server


  • start( port ) - Starts the server. Port defaults to 25. (Default SMTP port)


  • mail

    The most important one. Fires when mail an e-mail has been received. Returns the entire e-mail as a string. (Including headers)

  • connectionIncoming

    Fires whenever a connection is made to the server on your designated port by a client. Contains an object with client information.

  • connectionClosed

    Fires whenever a connection to the server is closed. Contains an object with client information.


var Mail = require("lazysmtp").Mail;
var mail = new Mail("", false);

mail.on("mail", function(email) {

    //Pass it on to a parser. Or don't. I don't care.


mail.on("connectionIncoming", function(client) {
    console.log("Connection from: " + client.address + " on port " + client.port);


MIT License.

npm loves you