How to Fix Gmail Account Setup and Authentication Errors in Outlook 365
Question details
Users are unable to add a Gmail account to Outlook 365 due to persistent authentication, JavaScript, or profile errors, even when IMAP is enabled and test emails are successfully delivered.

- Product
- Outlook 365
- Device & OS
- Windows
- Scenario
- Adding or configuring a Gmail account in the Outlook 365 desktop client.
- Observed behavior
- Outlook fails to complete the account setup. It may skip the password prompt, display a JavaScript error, or fail to add the account despite successfully sending a test message.
Before proceeding with registry edits or profile resets, ensure you have backed up your Windows registry to prevent accidental system changes, and verify that your Outlook application is fully updated.
Clear Outdated Windows Credentials and Identity Registry Keys
Removing old cached credentials and identities forces Outlook to launch the modern Google sign-in window for a fresh authentication session.
Often, Outlook stores outdated login tokens that prevent the standard Gmail password prompt from appearing. Clearing these from both the Windows Credential Manager and the Registry resolves the issue.
Open the Windows Start menu, search for 'Credential Manager', and open it. Under 'Windows Credentials', locate any items referencing MicrosoftOffice16 or your Gmail address and click 'Remove'.
Press Windows + R to open the Run dialog, type 'regedit', and press Enter. Grant administrator permissions if prompted.
In the Registry Editor address bar, paste or navigate to: HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity\Identities
Click through the subkeys under 'Identities' on the left side. Look at the right panel to find the one associated with your Gmail address. Right-click the corresponding folder key on the left and select 'Delete'.
Close the Registry Editor, restart Outlook 365, and attempt to add your Gmail account again. The proper Google sign-in window should now appear.

Resolve JavaScript Errors via Browser Emulation Registry
Apply a registry fix to ensure the embedded browser used by Outlook correctly renders the Google authentication page without JavaScript errors.
Create a Completely New Outlook Profile
A corrupted Outlook profile can prevent new accounts from saving properly, even if test messages succeed. Creating a new profile provides a clean slate.
Try WPS Office for a Hassle-Free Office Experience
If Outlook configuration bugs and complex registry edits are disrupting your workflow, consider downloading WPS Office. It provides a highly compatible, lightweight, and completely free alternative to Microsoft Office, ensuring you stay productive without wrestling with persistent authentication errors.
- 1. Download the Installer: Visit the official WPS website and download the free WPS Office installation file.
- 2. Install WPS Office: Run the installer and follow the quick setup wizard to install the software on your device.
- 3. Open Your Files Seamlessly: Launch WPS Office to instantly open, edit, and save your existing Office documents with full formatting preserved.

Frequently Asked Questions
Do I need an App Password to add my Gmail account to Outlook 365?
For the most recent versions of Outlook 365, App Passwords are usually not required for IMAP accounts. Outlook natively supports modern OAuth sign-in, which allows you to log in securely through a Google prompt. However, if modern authentication fails, you might need to clear cached registry identities to trigger it.
Why does Outlook successfully send a test message but still fail to add the Gmail account?
This situation indicates that the server connection and port settings are correct, but the local Outlook profile or the Windows identity cache is corrupted. The application connects to Gmail but fails to save the account settings locally. Deleting the specific account registry subkey or creating a completely new Outlook profile usually fixes this.
What should the manual server settings be for Gmail IMAP in Outlook?
Ensure IMAP is enabled in your Gmail web settings. In Outlook, set the Incoming mail (IMAP) server to imap.gmail.com with port 993 and encryption method SSL/TLS. The Outgoing mail (SMTP) server should be smtp.gmail.com with port 465 (SSL/TLS) or port 587 (STARTTLS).




