Two-Step Authentication, iPhone Mail.app, and SMTP
Solution 1:
Have you setup and install the iPhone App "Google Authenticator" ??
http://www.google.com/support/accounts/bin/static.py?page=guide.cs&guide=1056283&topic=1056285
Solution 2:
Open up the keychain application and locate the password that it has stored for your gmail account. Now delete it.
Then retry the process you have, ensure you put in your application specific password, and then ensure you press the checkbox that says to save password to keychain.
Further instructions and Mail.app specific screenshots here.
I believe that mail.app is using an older stored email and this is preventing access. I am assuming of course that mail.app was working perfectly for you before you started using two step authentication.
Solution 3:
Got it working by providing an application specific password instead of the usual gmail password. It would be a 16 char password and not the six char authentication verification code.
Solution 4:
that captcha thing fixed it
http://support.google.com/mail/bin/answer.py?hl=en&answer=78754