You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

simple-mail-smtp

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-mail-smtp

A straightforward Node.js library that enables you to launch your own native incoming SMTP server, effortlessly.

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

SimpleMail

SimpleMail is a straightforward Node.js library that enables you to launch your own native incoming SMTP server, effortlessly.

Getting Started

Usage

To get started with launching your SMTP server, you'll need to initialize it and specify a port. Additionally, you'll need to provide a callback function using the catch() method. This function will be invoked whenever a new email is received to your SMTP server.

const SimpleMail = require('simple-mail-smtp');
const server = new SimpleMail();
const port = 25;

function myFunction(parsed) {
  console.log('Email from ' + parsed.from.text + '!');
}

server.catch(myFunction);

// Start your SMTP server at port 25 (default)
server.listen(port, (serverIP) => {
  console.log(`SMTP server started at ${serverIP}:${port}`)
  // other logic
});

After running this command, your SMTP server will successfully start at the specified port. All emails will automatically be parsed with simpleParser and your function will be invoked.

DKIM Verification

By default, all emails received by your SMTP server will be automatically checked for DKIM verification. However, you may override this setting by using the verifyDKIM() function.

server.verifyDKIM(false); // DANGER: All incoming emails will be passed through your SMTP server

By overriding this function, all incoming emails will not be scanned for valid DKIM verification, and will cause an invoke of your callback function. DANGER ZONE!

Keywords

smtp

FAQs

Package last updated on 04 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts