HOW TO: Solve a Repeating Password Error when Setting up IMAP with Gmail in Outlook

Andrew LeniartIT Professional, Freelance Journalist, Certified Editor
IT Professional - Helping others to help themselves. &
Read this tutorial to learn how to fix repeating password error prompts when setting up Gmail IMAP with Microsoft Outlook. The entire process is described with step by step, illustrated instructions. Enjoy...

On various tech forums that I frequent, as well as at Experts Exchange, I often see people frustrated with the process of creating an IMAP (Internet Messaging Access Protocol) connection because Outlook keeps asking for a password, despite the correct password having been entered. The repeating password error prompt when trying to configure IMAP with a Gmail account in Microsoft Outlook is a common cause of frustration.

So why does it happen? The password error frequently occurs if you have 2-Step-Verification enabled on your Gmail account. But do not turn off this great security feature just to get around the problem - there is a much better way. 

The same error can also occur if you haven't enabled IMAP correctly or have disallowed Less Secure Apps to connect to your Gmail account when not using 2 Step Verification to secure your Gmail account. 

In this tutorial, I show step by step instructions, including screenshots, of everything you need to do. I show the way to enable IMAP, and how I've set up Gmail IMAP in Microsoft Outlook for my clients' dozens of times, with steps that will work every single time. I also show how to allow Less Secure Apps to connect to your Gmail account, which is necessary for Outlook to be able to successfully connect via an IMAP or POP connection if 2 Step Verification is not enabled.

Follow this process and you can say goodbye to those frustrating Password Error prompts forever. This tutorial uses screenshots from Outlook 2016, however, the steps are similar with most Outlook versions.

The setup processes described in this article are ideal for when you utilize 2-step-authentication with Gmail and from my experience, they work every single time.

Tip! Click illustrative images below to get a full-size view in a new browser tab or window.

So let's get to it!

Enable Less Secure Apps in your Gmail Account

Note: This only applies to Google Accounts that do not have 2 Step Verification turned on. It is not needed if you are using 2 Step Verification to access your Gmail account.

Gmail periodically sends out a standard Email to all members advising them to check the security settings on their accounts. A few of my clients have heeded the advice, only to find that their Outlook, which would connect to their Gmail account without any issues, would suddenly start having password issues. Here's how to stop it.

  1. Go to the Less Secure Apps section of your Gmail account
  2. Now turn on Allow less secure apps
  3. Done. 

Enabling IMAP on your Gmail Account

The first thing to do is to make sure your Gmail account is IMAP enabled.

Log into your Gmail account, and click the Gear Icon, and then click "Settings"

On the Settings page, click the Forwarding and POP/IMAP setting.

Ensure your "IMAP Status Setting" is set to Enable IMAP as shown below.

The other settings can be left as default, however, I'll explain what they all mean below. Once you're happy with your settings, click the "Save" button to save them. You have now enabled your Gmail email account for IMAP.

What do the " IMAP Access: " options do?

  • Status: IMAP is disabled - This needs to be changed to a Green "IMAP is enabled" message if not already set, by simply clicking the "Enable IMAP" radio button and saving changes.

  • When I mark a message in IMAP as deleted: Auto-Expunge on or off determines how deleted messages will be treated. By leaving Auto-Expunge on, when you delete a message in Outlook, the same message will be immediately deleted from the Gmail server.

    I prefer to change this setting to "Auto-Expunge off" as shown above because then the IMAP connection is not constant even if Outlook is open. So if I accidentally delete a message in Outlook, I can restore it before the Gmail server is updated with my changes.

  • When a message is marked as deleted....etc: By turning Auto-Expunge to Off, we now have other options to consider. The default is to Archive the message. Pretty self-explanatory.

    I prefer to set that option to "Move the message to the Trash" so that the Gmail server will be the same as my Outlook.

    Setting the last option will delete the message forever, without an opportunity to recover it.

  • Folder Size Limits again is pretty self-explanatory. I suggest you leave that at its default - "Do not limit the number of messages in an IMAP folder."

Once you click "Save Changes" as per the image above, your browser will return you to your online Gmail Email account page. You can now close that page, we're done with it.

Once you've made sure that IMAP is enabled on your Gmail account, proceed to the next step.

Generating a Unique App Password in Google

The first thing you're going to need to do is to is create an "App Password" in your Google Gmail account to use with Outlook. Perform the following steps.

1. Log into your Gmail account and once logged in, click your name or the avatar of yourself 

2. Click the My Account button

3. Now click the "Signing in to Google" Link on the left of your browser screen

4. Under "Password & sign-in method", click "App Passwords" 

5. You'll now be prompted to enter your password again to verify that it's really you trying to access this security feature. That's expected, so enter your Google Gmail password and click the NEXT button

6. You'll now be on the "App passwords" page. Click the "Select app" drop arrow as shown below and select Mail. 

7. Then click the "Select Device" drop arrow and select the appropriate device. In this example, I'm setting up on a Windows Computer so that's what I've selected.

8. Once done, the "GENERATE" button turns from Ghosted to Blue and is able to be clicked. Click the GENERATE button.

If you've never set up an app password as yet, then you won't have entries similar to what you see below. If that's the case, all is fine, you'll have one soon.

9. Gmail generates an App Password called "Mail on my Windows Computer." Take a copy of the 16 character password in the yellow box - you'll need it later! 

10. Once you've taken a note or copy of the generated app password in the yellow box, click the "Done" button

*Note to any hackers reading this - Don't bother trying - the example below has already been revoked!  :)

That's all we need to do in Google Accounts, so you can log out or just close your browser now. It's time to get started with Outlook.

Setting up Outlook with Gmail using IMAP

The following set up example is showing Outlook 2016 - current at the time of writing. However, the basic principles and steps should be similar to all versions of Outlook.

A) Open Outlook and click File > Add Account

B) The Welcome to Outlook wizard pops up. Enter your Gmail email address in the box, click "Advanced Options" and put a tick in the box marked "Let me set up my account manually" and then click the "Connect" button.

C) A "We're getting things ready" box will appear for a few seconds and then you'll be prompted to "Choose an Account Type." Click on the IMAP icon.

D) Note the settings in the next screenshot and make sure yours are the same. They should be pre-filled in for you, but just in case they're not...

Here are the settings in written format if you want to copy and paste:

Server:  Port:  993

Encryption method set to SSL/TLS

Outgoing mail:  Port: 465

Encryption method set to SSL/TLS

With that out of the way, click the "Next" button on the above window.

E) Here's where you need that 16 character App Password that we generated and copied in Step 10 above. Ignore the spaces in the generated password and just enter all 16 characters of the password on the following screen, and then click the blue "Connect" button.

If you get an error the first time, click "Try Again" - it always works for me on the second try. You should end up with the following "Account setup is complete" window.

F) I suggest you untick "Set up Outlook Mobile on my phone too" (you can set that up later) and then click the OK button.

Once the OK button has been clicked, Microsoft Outlook creates the IMAP account and begins populating it with all of the emails that are saved on the Gmail server. You will also find a Test Message automatically sent by Microsoft Outlook to test the connection.

The data file that Microsoft Outlook will create will be an OST (Offline Storage Table) and it will be located in:


This will not interfere with the operation of any PST files that you have.

Finished and Done!

Congratulations, you've now successfully set up an IMAP connection between Microsoft Outlook and your Gmail email service. No need to log into Gmail to deal with your Gmail email anymore - you can now do it all from the familiar GUI interface you've gotten used to in Outlook. 

To refresh Outlook and make sure it's synchronized with Gmail, simply click the Send/Recieve button. Or, if you prefer, ensure there is a tick in the following Outlook location;

File > Options > Advanced > Send/Receive > Schedule an automatic send/receive every xx minutes.

You can even have Outlook continue to check for any new mail and update itself when it's offline by putting a tick in the bottom Offline Settings value.


Every step described above was followed and tested during the writing of this article with Outlook 2016 on a Windows 7 Professional installation, so there should be no reason for it not to work in any supported version of Microsoft Windows. The process will also be very similar if using a Macintosh OS X, Windows 10 and others.

However, should you need further help on this process, I encourage you to use the free "Ask a Question" feature at Experts Exchange. I monitor questions asked about this topic and will be glad to help you further if necessary.

Author: Andrew Leniart

Andrew LeniartIT Professional, Freelance Journalist, Certified Editor
IT Professional - Helping others to help themselves. &

Comments (12)

Andrew LeniartIT Professional, Freelance Journalist, Certified Editor
Author of the Year 2019
Distinguished Expert 2020


Pleasure Arvin and I look forward to your update. Also, if you found my article helpful in any way, if you could click the Thumbs Up button at the bottom left at the end f the article to endorse it, I'd much appreciate it :)  Regards, Andrew
Thank you SO MUCH Andrew!  Your article helped me resolve the issue I was experiencing with Outlook.  I had no idea that 2SV would impact my Outlook app, but of course it did (and when I think about it, of course it did).  Your article was spot on!  Very easy to follow and extremely well detailed (love the screenshots too).  I really appreciate you publishing it and providing assistance to folks that have experienced this issue. Thanks again!

Best regards,
Andrew LeniartIT Professional, Freelance Journalist, Certified Editor
Author of the Year 2019
Distinguished Expert 2020


You're very welcome Mark, I'm pleased to hear it helped you out and thank you for your very kind feedback. If you could also take a moment to endorse the article by clicking the thumbs up at the bottom, it would be much appreciated.

Regards, Andrew
Thanks for the reminder regarding the thumbs up at the bottom of the article Andrew, I just clicked it.  And thank you again for writing it, it was very helpful.

Basem KhawajaClinical Pharmacist


Very helpful article indeed. I know I will use it in the near future if I decide to add Gmail to Outlook.

Thank you once again Andrew,

Basem Khawaja

View More

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.