Hi, i had the exact same problem after upgrading to 10.8.2. all my gmail accounts in my Apple Mail account suddenly stopped sending mail and it doesn't accept my password.
After an exhausting all options, i finally found a fix. The problem is most likely with gmail (or maybe apple too).
Google introduced a new security measure called 2-step verification which assigns a unique password PER application that uses gmail - which you are supposed to only enter once. Current settings for 2-Step Verfication is set at OFF. You can turn this ON by logging into your gmail via web and go to ACCOUNT SETTINGS under SECURITY.
I turned ON my 2-step verification followed the instructions and clicked on generate password for my APPLE MAIL and used that new password on my APPLE MAIL gmail password. Don't forget to change the password in the SMTP server as well.
I used the same password for my iOS Mail and it works too.
Everything started working again....I know it is a bit of an effort especially if you have multiple gmail accounts but anything that improves your online security is worth doing. Gmail said we only have to input the long passwords once - let's hope it's true.
I'm attaching a link on gmail's 2-step verifcation setup. Hope this helps! Cheers!
http://support.google.com/a/bin/answer.py?hl=en&answer=175197