Gmail Error "Invalid login: Application-specific password required"

Last Updated: Jul 29, 2024

Overview

When trying to use Gmail/Google as an SMTP Provider for Emails, an error similar to the one below can appear:

Invalid login: Application-specific password required

This happens if MFA is enabled on the Gmail account.

Applies To

  • SMTP Provider for Emails
  • Gmail
  • Custom Email

Solution

If the two-factor authentication is enabled on the Google account, it is not possible to use a regular password to access Gmail programmatically. An app-specific password needs to be generated and used in place of the actual password.

Steps:

  1. Log in to the Google account. Go to My Account > Sign-in & Security > App Passwords (Sign in again to confirm it is you).
  2. Scroll down to Select App (in the Password & sign-in method box) and choose Other (custom name).
  3. Give this app password a name, e.g., “nodemailer”, choose Generate Copy, and the long generated password paste it into the password field in the Dashboard’s SMTP Provider

Related References