Gmail rejects SMTP password with 2-factor authentication

authenticationgmailmacsmtp

I am using the Mail app on Mac OS X to access my Gmail account using 2-factor authentication. The app is configured with an application-specific password and it works fine for a few days: email can be sent and received without a problem. But then I get this error message:

The SMTP server "smtp.gmail.com" rejected the password for user
"….@gmail.com"

From this point on no emails can be sent, although I still get incoming messages via IMAP.

If I revoke the app-specific password, generate a new one, and enter it in the app, it fixes the problem for a few days. Then I get this error again and must enter a new password. This has been going on for months.

Before I turned on 2-factor authentication, everything worked smoothly.

I also have Gmail configured on my iPhone with a different app-specific password, and there this problem does not occur.

Best Answer

The application-password that you create will need to be added in two places in your Apple Mail app.

There is your Incoming Mail Server password, which is immediately visible under your account information.

Below that you can see the selection for Outgoing Mail Server (SMTP). The default will be Gmail. Click on the drop down box and select "Edit Server List".

Here you will discover that you actually need to enter that application-password a second time. Put it in here and you're done.

The other reference to application-passwords expiring is incorrect. ONE-TIME passwords do. If you use the regular application passwords you would log in to your account settings and revoke them when no longer needed.