/nodejs-sending-receiving-emails

An example of using nodemailer to send emails, imap-simple to fetch emails, and mailparser to parse emails.

Primary LanguageJavaScriptMIT LicenseMIT

NodeJS Sending Receiving Emails

Introduction

Demonstration

This repository demonstrates working with emails in NodeJS;

  • Using nodemailer to create a test email account (via Ethereal) and to send an email.
  • Using imap-simple to connect to the test email account via the Ethereal IMAP server and search for unread messages.
  • Using mailparser to take an entire email (headers and body) and parse it.

Instructions

These instructions assume you are running a version of NodeJS equal to or greater than the version mentioned in the .nvmrc file, and have Yarn installed:

  1. Install dependencies.
yarn install
  1. Run the start command and observe the output.
yarn start

Note: The credentials shown in the terminal output will be valid for a short period of time. You can use them to log into Ethereal and see the email in their web based email client.

Further Information