How to Set Up Gmail IMAP with an App Password
To connect a Gmail account to a third-party program such as Thunderbird, desktop Outlook or your own software, you need two things: the right IMAP/SMTP settings and an app password. For security reasons Google no longer allows these connections with the normal account password.
What is an app password?
An app password is a 16-character, single-purpose password generated for your Google account. It lets one program access the mailbox without handing over your main password, and you can revoke it and create a new one at any time.
1. Turn on 2-Step Verification
App passwords can only be created on accounts with 2-Step Verification enabled. Turn it on under Google Account > Security. If it is already on, skip to the next step.
2. Create the app password
- Open App passwords at the bottom of Google Account > Security > 2-Step Verification (direct address: myaccount.google.com/apppasswords).
- Give it a name you will recognise, for example "Thunderbird".
- Copy the 16-character password shown on screen. It will not be shown again.
3. Enter the IMAP and SMTP settings
- IMAP server: imap.gmail.com, port 993, SSL/TLS
- SMTP server: smtp.gmail.com, port 465 (SSL) or 587 (STARTTLS)
- Username: your full Gmail address
- Password: the 16-character app password (without spaces)
Common problems
"Username and password not accepted": the normal password was most likely used; use the app password instead. No App passwords section: 2-Step Verification is off, or the account only uses a security key. Connections drop after a few attempts: logging into many accounts in a row from the same IP can trigger Google security checks; space out your connections.
Gmail with the app password ready
If you would rather skip these steps, our Gmail with app password products come with 2-Step Verification and an app password already set up, so you can connect them to your software straight away.