To begin our discussion on DI, let's create a simple Node application that sends an email. Sending mail is a common requirement of most systems, and is generally one of the first use cases that need to be built in order to allow users to register with a website. Even before a user has logged into your site, their registration details need to be captured, and part of this process usually includes an email address verification. So, let's explore how to send an email using Node.
Sending mail
Using nodemailer
There are a variety of Node-based packages that we can import to give us email capability. In this chapter, we will use the nodemailer package, which can be installed as follows:
npm install --save nodemailer...