---
title: "Discussion on \"Send emails in Node.js using Nodemailer, Gmail & oAuth2\" | Hashnode"
description: "Discussion on \"Send emails in Node.js using Nodemailer, Gmail & oAuth2\". In this article, I'm gonna discuss How to configure your gmail account for sending emails in node.js using nodemailer & oAuth2.\nPreviously, we had an option for sending emails in node.js via gmail by allowing less secure apps in your gmail settings, ..."
url: "https://hashnode.com/posts/send-emails-in-nodejs-using-nodemailer-gmail-oauth2/63fef137e92069639b2c090a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Send emails in Node.js using Nodemailer, Gmail & oAuth2](https://rupali.hashnode.dev/send-emails-in-nodejs-using-nodemailer-gmail-oauth2?utm_source=hashnode&utm_medium=feed)

In this article, I'm gonna discuss How to configure your gmail account for sending emails in node.js using nodemailer & oAuth2. Previously, we had an option for sending emails in node.js via gmail by allowing less secure apps in your gmail settings, ...

Mar 1, 2023 · 3 min read · rupali.hashnode.dev  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#email](https://hashnode.com/tag/email)
-   [#nodemailer](https://hashnode.com/tag/nodemailer)
-   [#googleapis](https://hashnode.com/tag/googleapis)
-   [#oauth2](https://hashnode.com/tag/oauth2)

## Written by

[Rupali Haldiya](https://hashnode.com/@rupali-codes)

@rupali-codes · 127.0.0.1:IN

  
[View profile](https://hashnode.com/@rupali-codes)

Full-stack JavaScript Developer

Full-stack JavaScript developer and Open-source Advocate.

## Responses 4

Markdown supported · ⌘↵ to post

[Hafiz Ahmed](https://hashnode.com/@hafiz182)

[Jul 25, 2024](https://hashnode.com/posts/send-emails-in-nodejs-using-nodemailer-gmail-oauth2/63fef137e92069639b2c090a/comment/66a29f5636006468fe116ee6)

after a week it show gaxios error GaxiosError: invalid\_grant at async OAuth2Client.refreshTokenNoCach

[elif küçükaydın](https://hashnode.com/@elifkucuk)

[May 27, 2024](https://hashnode.com/posts/send-emails-in-nodejs-using-nodemailer-gmail-oauth2/63fef137e92069639b2c090a/comment/66547dbdc9530ee43d6028d2)

This is very clear and nicely summarized. Thank you!

[Moshe Fortgang](https://hashnode.com/@moshe0726)

[Mar 27, 2024](https://hashnode.com/posts/send-emails-in-nodejs-using-nodemailer-gmail-oauth2/63fef137e92069639b2c090a/comment/66040a073229ff443a59d342)

There is a mistake in the installation command. It should be:

npm install nodemailer gooogleapis dotenv "gooogleapis" should appear with 2 'o's instead of 3

[Satvik Manchanda](https://hashnode.com/@Satvik1769)

[Oct 24, 2023](https://hashnode.com/posts/send-emails-in-nodejs-using-nodemailer-gmail-oauth2/63fef137e92069639b2c090a/comment/653777adc6b0d16a576ff5a3)

hey i was thinking of adding a functionality where multiple users can send to other email user how can i do that do i have to ask for their client and secret id refresh token etc. or their is some way that i can authenticate without doing this?
