My problem may have been the same as yours, and LooseNeutral'ssolution is very much like the one that found. Long story, not sure whether I should shorten it because hey, who knows, the details might be helpful to someone.
I'm running Snow Leopard (Mac OS X 10.6.8) on my tower and Mavericks (Mac OS X 10.9.5) on my laptop. I hadn't been receiving email on the tower since it died two years ago, bought the laptop, decided to start using the tower again a few days ago, and couldn't get my gmail accounts to send or receive. An Apple tech suggested that it may have had something to do with kerberos .plist files I had deleted—a kerberos problem was intermittently slowing down my system, removing the kerberos .plist files solved that problem but we thought it might be responsible for the problem with gmail. I jumped through a lot of hoops over several days trying to solve this, including putting a spare hard drive in my tower and partitioning it for fresh Snow Leopard and Yosemite (10.10.1) installs. Gmail accounts could send and receive from the fresh Yosemite partition, but not from the fresh Snow Leopard partition.
As I tested Apple Mail Version 4.6 (1085), I kept receiving warnings from Google at the gmail address—which was able to send and receive from Mavericks on my laptop running Apple Mail Version 7.3 (1878.6)—that Google had blocked sign-in attempts. Checking the security settings on my gmail account, I found that Google was referring to an "Unknown Device," meaning Apple Mail 4.6 on Snow Leopard on my tower. One solution they suggested was to run "DisplayUnlockCaptcha," which didn't help. Another solution was to enable "Less Secure Apps" to work with my gmail account. I was unable to find a list of "Less Secure Apps," so I don't know whether Apple Mail Version 4.6 is on it. Enabling Less Secure Apps did not work at first. I tried it again, following advice on another thread, and it appears to have worked. Here's the exact process I followed:
Quit Apple Mail. Log out of the Google account on Safari. Log back into the Google account on Firefox. Enable Less Secure Apps. Open Apple Mail. Problem solved.
Google keeps telling me that my browser (I'd been using Safari) is out of date: "This version of Safari is no longer supported. Please upgrade to asupported browser." I get that message at the top of the browser window in the most up-to-date versions of Safari that work with 10.6.8 and 10.10.1, so I tried Firefox. Also, googling "make unknown device known to gmail security" returned no relevant results.
So. I don't know where I went right, but I did. I do hope this helps someone!