Send mail in Node through Nodemailer and Sendgrid

Sagardhiman
2 min readJan 15, 2021

--

Source: Google

In this tutorial, we will see how to send email in node js through Nodemailer and Sendgrid.

Firstly we will what is Nodemailer and Sendgrid.

Nodemailer: Nodemailer is a module for Node.js to send emails.

Sendgrid: SendGrid is a cloud-based SMTP provider that allows you to send email without having to maintain email servers.

Now you need to execute the below commands to install both dependencies

  • npm install nodemailer
  • npm install –save sendgrid

After that you need to create an account on Sendgrid, it’s very simple after creating an account you see an option Create Api on the left sidebar just click on it and create your own API, after that click on Email registration and click on Single EMail option and fill-up the form with a Valid Email address after that go to your Email and verify it as shown below.

After that, you just need to send the email through Nodemailer and Sendgrid as shown below.

Your API Key will be different
In from section, you will use your own verified Email which you have verified in the above steps and the sendMail function is used to send mail.

If you have any doubt just comment below and want a tutorial about certain topics also comment below.

--

--

No responses yet