> For the complete documentation index, see [llms.txt](https://inno-sufiyan.gitbook.io/smit-b-10/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inno-sufiyan.gitbook.io/smit-b-10/smit-b-10/backend/send-email-nodemailer/email-password-for-send-email.md).

# Email / Password for Send Email

#### Getting Email and Password for Gmail Services

To use Gmail as your email service for Nodemailer, you need a Gmail account and an App Password. Google restricts the usage of regular account passwords for third-party apps for security reasons. Follow these steps to generate an App Password for your Gmail account.

***

#### Step-by-Step Guide to Generate an App Password

**1. Enable 2-Step Verification**

First, you need to enable 2-Step Verification for your Google account:

1. Go to your Google Account: myaccount.google.com.
2. Click on "Security" in the left-hand menu.
3. Under "Signing in to Google," find "2-Step Verification" and click on it.
4. Follow the on-screen instructions to set up 2-Step Verification.

**2. Generate an App Password**

After enabling 2-Step Verification, you can generate an App Password:

1. Go back to your Google Account: myaccount.google.com.
2. Click on "Security" in the left-hand menu.
3. Under "Signing in to Google," find "App passwords" and click on it.
4. You might need to sign in again.
5. Under "Select the app and device you want to generate the app password for," select "Mail" and "Other" (name it "Nodemailer" or something similar).
6. Click "Generate."
7. Google will provide a 16-character App Password. Copy this password.

***

#### Using the App Password with Nodemailer

Replace your actual Gmail password with this App Password in your environment variables. Here’s how to update your `.env` file:

```env
envCopy codePORTAL_EMAIL=your-email@gmail.com
PORTAL_PASSWORD=your-app-password
```

Ensure that you keep this App Password secure and do not hard-code it into your application.

**Instructor: Muhammad Sufiyan**

**Linkedin:** [**https://www.linkedin.com/in/innosufiyan/**](https://www.linkedin.com/in/innosufiyan/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://inno-sufiyan.gitbook.io/smit-b-10/smit-b-10/backend/send-email-nodemailer/email-password-for-send-email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
