Quick answer
| Setting | Incoming (IMAP) | Outgoing (SMTP) |
|---|---|---|
| Server | imap.gmail.com | smtp.gmail.com |
| Port | 993 | 465 |
| Encryption | SSL/TLS | SSL/TLS |
| Username | Your full Gmail address | |
| Password | A 16-character app password (not your Google password) | |
SMTP also works on port 587 with STARTTLS. Use it if port 465 is blocked on your network.
Before you start
- Google no longer lets third-party apps sign in with your normal Google password. Any app that asks for a password needs an app password instead.
- App passwords only appear once 2-Step Verification is turned on for your Google Account.
- Gmail keeps IMAP access turned on for every account, so there is no IMAP setting to enable in Gmail itself.
- On a Google Workspace (work or school) account, your administrator can disable app passwords or IMAP. If the options are missing, ask them.
How to create a Gmail app password
- Open myaccount.google.com and go to Security.
- Turn on 2-Step Verification if it isn’t on already.
- Go to myaccount.google.com/apppasswords, or type “App passwords” into the search bar at the top of your Google Account.
- Enter a name you’ll recognise, such as “MailsOnMine”, and click Create.
- Copy the 16-character password Google shows you and paste it into your email app’s password field. Spaces don’t matter. Google shows it only once, so if you lose it, delete it and create a new one.
Common errors and how to fix them
- “Username and password not accepted” or AUTHENTICATIONFAILED
- You used your normal Google password. Create an app password (steps above) and use that instead.
- The “App passwords” page doesn’t exist
- 2-Step Verification is off, your account uses Advanced Protection, or your Workspace administrator has disabled app passwords.
- A working app password suddenly stops working
- Google revokes all app passwords when you change your Google Account password. Create a new one.
- Connection timed out
- Your network or hosting provider is blocking outgoing mail ports. For sending, try port 587 with STARTTLS instead of 465.
Use Gmail alongside your other accounts
MailsOnMine puts Gmail, Outlook and your other IMAP accounts in one unified inbox. Add a new account, type your Gmail address and the IMAP and SMTP fields above are filled in for you. Then paste your app password.
Try MailsOnMine freeFree plan: 1 connected account, no card required.
Frequently asked questions
Is Gmail IMAP free?
Yes. IMAP access is included with every Gmail account at no extra cost.
Should I use port 465 or 587 for Gmail SMTP?
Both work. Port 465 uses SSL/TLS from the first byte; port 587 starts unencrypted and upgrades with STARTTLS. If one is blocked on your network, use the other.
Can I use Gmail in another app without an app password?
Only if the app offers “Sign in with Google” (OAuth). Any app that asks you to type a password needs an app password.