How to use SendGrid with Nodemailer to send mails.

Step 1: Making an account and verifying a single sender.

Step 2: Integrating SendGrid SMTP with Nodemailer

Create Nodemailer transport

const nodemailer = require('nodemailer');const nodemailerSendgrid = require('nodemailer-sendgrid');const transport = nodemailer.createTransport(nodemailerSendgrid({     apiKey: process.env.SENDGRID_API_KEY  }));

Send a message

transport.sendMail({   from: 'xyz@gmail.com',   to: 'Receiver Name <receiver@example.com> ,        someother@example.com',  subject: 'hello world',  html: '<h1>Hello world!</h1>'});