After upgraded the Mac operating system to El Capitan on my MacBook Air, the Gmail account settings within the Apple Mail app seemed to have gone corrupted. When starting to login for email checking, it would always give an error message similar to “unable to verify username and password”.
It couldn’t login to retrieve emails no matter how I checked the password, other settings and they were all correct. Within the Apple Mail app, there are some other email accounts too and only Gmail account was not working right. Inputting the correct password again and again but was in vain.
Searching online for helps, had read some articles & forums particularly for this similar El Capitan’s Apple Mail connection error, didn’t help much.
Yes, if I add a new Gmail IMAP account, it would work. However, my last Gmail setup was a POP account and I want to stick with it since I noticed that mailing rules created within the Apple Mail app stop ruling for emails that comes to it if retrieves under an IMAP account.
A few days later, finally I found the answer to this Apple Mail with Gmail connection problem after upgraded to El Capitan OS! If you have this error too or somewhat similar, you may want to try out the solution as follows.
1. Check keychain utility for expired certificates, delete it. Then check gmail settings below with a browser.
2. After login to Gmail online, go to within settings and click on “Other Google account settings”.
3. Click on “Connected apps and sites”.
4. Turn on the “Allow less secure apps”.