Skip to content
Nearlysent
Docs menu

Connect Gmail with an app password

Connect a Gmail or Google Workspace mailbox over IMAP and SMTP with a Google app password. Turn on 2-Step Verification, create the app password and test the connection.

Nearlysent reads your Gmail over IMAP and sends replies over SMTP. Google does not accept your normal password for this. You need an app password: a separate 16-character password that only works for mail programs and that you can revoke at any time without changing your Google password.

This works for personal Gmail addresses and for Google Workspace accounts (if your administrator allows app passwords).

1. Turn on 2-Step Verification

App passwords only exist when 2-Step Verification is on.

  1. Open Google: 2-Step Verification (Google Account → Security → 2-Step Verification).
  2. Follow Google’s steps to turn it on. Skip this if it is already on.

2. Create an app password

  1. Open Google: App passwords (Security → 2-Step Verification → App passwords).
  2. Type any name, for example the name of this app, and click Create.
  3. Google shows a 16-character password once. Copy it. You can type it with or without the spaces.

Don’t see App passwords? Then 2-Step Verification is not on yet, your account uses only security keys (Advanced Protection), or your Google Workspace administrator has turned app passwords off.

3. Add the mailbox

  1. In your workspace go to Settings, tab General, card Mailboxes, and click Add mailbox. You need the Admin or Owner role.
  2. Mail provider: choose Gmail. The form shows “Gmail needs an app password” with the same steps and links.
  3. Email address: your full Gmail address. Username can stay empty: it then uses the email address.
  4. Display name (optional): the sender name customers see, for example your company name.
  5. Password: paste the app password.
  6. Click Test connection.

The Gmail preset uses these server settings. You only need them if you change something under Advanced: server settings:

Server Port Encryption
Incoming mail (IMAP) imap.gmail.com 993 SSL/TLS
Outgoing mail (SMTP) smtp.gmail.com 465 SSL/TLS

Port 587 with STARTTLS also works for outgoing mail.

4. Check the test result

Below the form, the test shows one line for Incoming mail (IMAP) and one for Outgoing mail (SMTP). Both must say Connected. Then click Connect mailbox.

You see “Mailbox connected. The first sync starts in a moment.” Within a few minutes (or right away with Sync now) the Inbox shows your threads from the last 14 days. The mails stay unread in Gmail.

Common errors

Message What to do
Wrong password — Gmail needs an app password, not your normal password. You used your Google password, or the app password was copied wrongly. Create a new app password (step 2). Here’s how jumps to the steps.
Could not reach the server. Check the server name and port. Check the settings under Advanced: server settings against the table above.
The secure connection failed. Check the encryption setting (SSL/TLS or STARTTLS) and the port. Port 993 and 465 need SSL/TLS; port 587 needs STARTTLS.
The server did not answer in time. Try again. If it keeps happening, check the server name and port.

The test did not pass but you want to save anyway? That is allowed, but the mailbox does not sync until the connection works.

Later: a changed or revoked app password

If you revoke the app password in Google, the next sync stops. The mailbox shows the status Error and the Inbox says “Syncing stopped for” your address. Create a new app password, click Edit on the mailbox, paste it into Password, Test connection and Save.

When you change the IMAP or SMTP server of a saved mailbox, you are asked to enter the password again: it is only ever sent to the server it was saved for.

What happens to your Gmail

  • Mails are read without marking them as read.
  • Replies you send appear in Gmail’s Sent folder and in the same conversation as the customer’s email.
  • Save to my mailbox drafts puts a copy in Gmail’s Drafts.
  • Removing the mailbox in Nearlysent deletes its imported threads here. Nothing changes in Gmail itself.

Something unclear or missing in the docs?Tell us.