Using Nodemailer with Gmail

Cinque Web Development
3 min readFeb 22, 2021

If you are trying to implement forgot password functionality into your authentication then you are going to need to use a service like Nodemailer to get the job done.

These are the steps to get that done.

  1. Set up a transport on Nodemailer.

2. Set the transport to a variable

3. Write out what you want the email to say when sent.

4. This is what the entire forgot password function will look like:

If you don’t know how to set up this function please check out Forgot password functionality with JWT Authentication.

The next sets are going to be how to set up your google account to use Nodemailer.

  1. Click manage your google account

2. Make sure the google account you are using does not have 2 factor authentication enabled, if it does then change it to disabled.

3. This is so Nodemailer can send an email through this account.

4. Go into google account → security and scroll down to less secure app access and turn it on.

After you do these changes to your google account you will be able to use Nodemailer in your project.

If you want to use a full JWT Authentication template, and put it right in your project Here is a link to use that.

Please checkout Cinque Web Development for projects that we are working on and things that we have coming in the future.

Thank you for reading.

--

--

Cinque Web Development

Sharing our experiences with different technologies and ideas.