1.2.13 • Published 10 months ago

@raabbajam/pluto-email v1.2.13

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

pluto-email

This module will start a mail server to receive incoming email.

It has three functionality:

  • HTTP-Server. Run a http server to receive incoming email.
  • FTP-Client. Put a file on ftp client.
  • Event-emitter. Attach handler and emit data on event.

Install

npm i -D pluto-email

Usage

  • Generate random email address that you want to use as an email receiver
  • Tell the sender to let them know you expect them to send an email to the generated random email address
  • Listen to the specified email address, validated the email subject and only process the expected message
import plutoEmail from "pluto-email"

const emailAddress = plutoEmail.generateAddress(); // true
askMessageToBeSentToThisAddress(emailAddress)
	.then(() => plutoEmail.waitMessageFor(emailAddress, [optionalValidation, timeout, options]))
	.then((message) => {
		// message contain data message, sender, etc.
	});

License

MIT © Raabb Ajam