The email module is used for sending the email notification whenever a trespasser enters our premises along with evidence in the form of a video or photograph as an attachment with the email. To accomplish this task, we use the npm module nodemailer. Download this by running the npm install nodemailer command in the terminal as shown in Figure 6.24. Check out the official link for the nodemailer npm module at https://www.npmjs.com/package/nodemailer.
Create a file with the name EmailModule.js and include the nodemailer module in it.
var nodemailer = require('nodemailer');
Now, we set the transport configuration ...