Connecting Gmail via IMAP with an app password

Google has removed the “less secure apps” option. To connect Gmail to a third-party tool via IMAP, you now need an app password, which requires two-step verification to be enabled. The process takes five minutes and doesn't depend on any OAuth authorization that could expire.

Why IMAP rather than OAuth

A Google OAuth connection in testing mode expires after seven days: the analysis silently stops and you have to reconnect every week. An IMAP app password, on the other hand, stays valid until you revoke it. For a tool that needs to fetch your emails continuously, it's the most stable solution — and you keep one-click revocation from your Google account.

Step 1 — Enable two-step verification

  1. Open your Google account management, Security section.
  2. Choose “2-Step Verification” and follow the setup (phone number or authenticator app).
  3. Confirm: without this step, the app password option won't appear.

Step 2 — Generate the app password

  1. Still in Security, look for “App passwords.”
  2. Create an entry, name it for example “Happy Assistant.”
  3. Google shows a 16-character code in four groups. Copy it right away: it won't be shown again.
This code grants access to read and manage your mailbox and may also enable sending: treat it like a password. It does not replace your Google password and can be revoked independently.

Step 3 — Enter the connection details

In Happy Assistant, open your profile then “Connect Gmail (IMAP).” The server settings are pre-filled; only two fields need to be entered.

FieldValue
IMAP serverimap.gmail.com
Port993 (SSL/TLS)
Usernameyour full Gmail address
Passwordthe 16-character code, without spaces

After confirming, a first batch of recent messages is analyzed, then fetching continues automatically. If the connection fails, the cause is almost always one of three: two-step verification not enabled, regular password used instead of the app code, or spaces left in the copied code.

Connect mailboxes and verify sending

  1. Open Email, then Mailbox, and choose a mailbox. Browse folders, open a message or search the current folder.
  2. To reply or compose, check that sending is enabled. Otherwise open mailbox settings and verify the outgoing server (SMTP).

Compose a message, reply to the sender or everyone, or forward an email’s text. Add CC/BCC recipients and attachments from your device. Save drafts to continue later; configure a sender name and signature for each mailbox. Sending requires a verified outgoing server.

What about other providers?

ProviderIMAP serverPort
Gmailimap.gmail.com993
Outlook / Hotmailoutlook.office365.com993
iCloudimap.mail.me.com993
Freeimap.free.fr993
Orangeimap.orange.fr993

Requirements vary by provider: app password, authorised IMAP/SMTP access or administrator restrictions. Check its settings; compatibility is not guaranteed for every account.

Frequently asked questions

How do I revoke access later?

From your Google account, go to Security then “App passwords,” and delete the entry you created. Access is cut immediately, without changing your Google password.

Are my emails copied to a server?

Messages are fetched from your provider for display; the mailbox is not a separate archive of your entire history. Analysis keeps extracted items and technical identifiers. Drafts are saved in the provider’s Drafts folder, with technical references in the app. Mailbox credentials are encrypted and access is restricted to your account.