Back to Tools

Configure Email Sending with Gmail and Nodemailer

Follow this guide to enable email sending from the application.

Step 1: Generate an App Password in Google
For security reasons, Google no longer allows using your main password directly. You must generate a specific password for this application.
  1. Go to your Google Account settings: myaccount.google.com
  2. In the left menu, click on Security.
  3. Make sure 2-Step Verification is turned on. If it's not, you'll need to enable it first.
  4. Once enabled, find and click on App passwords.
  5. You will be prompted to sign in again.
  6. On the App passwords page, in the "Select app" dropdown, choose "Mail".
  7. In "Select device", choose "Other (Custom name)" and enter a descriptive name, like "BordonCakesApp".
  8. Click Generate. You will be shown a 16-character password.
  9. Important! Copy this 16-character password (without the spaces). You will need it for the next step and you won't be able to see it again.
Step 2: Add Credentials to the .env File
Now you need to save your email and the app password securely in the project.
Warning: The .env file is for storing sensitive information. Never share this file or upload it to public repositories like GitHub.

Open the file named .env located in the root of your project and add the following lines, replacing the example values:

GMAIL_USER="your-email@gmail.com"
GMAIL_APP_PASSWORD="the-16-character-password"
  • GMAIL_USER: Your full Gmail email address.
  • GMAIL_APP_PASSWORD: The 16-character password you generated in the previous step (paste it without spaces).
Step 3: Restart the Application

For the application to load the new credentials from the `.env` file, you need to restart it completely. If you are running it locally, stop it (with Ctrl+C in the terminal) and start it again.

Once restarted, email sending should work correctly!