How to setup Gmail SMTP server for OSX Mail with 2-step-verification and App-specific password? Haven't been able to solve this problem with the threads such as here.
My Gmail stops always working after a while, perhaps after accessing it in different WIFI network or something like this -- it is really driving crazy thing. The Gmail account uses 2-step-verification and app-specific password. I cannot understand this SMTP thing.
How to configure Gmail with App-specific password and 2-step-verification to OSX Mail?
Helper question


how to add the app-specific password to keychain?

app-specific password used in the Internect Access list?



Description and issues
The SMTP server is used to send mail.

(Note: There are two locations you must paste you app-specific password, these instructions are for the 'sending' server, not the 'receiving' server')

Go to Google and generate an app-specific password on this page.

Now open Mail and go to Preferences > Accounts and select your Google account. At the bottom of the right hand pane it will say "Outgoing Server (SMTP):" and should have "Gmail" selected/ Click on this and you get a pop up menu and select "Edit SMTP Server List".

(This accounts area is where you paste in your 'recieving' password under 'incoming mail server'. Incoming server should be: imap.gmail.com, your username should be the start of your email address without the '@gmail.com' section and your password should be the app-specific password, NOT the account password that was previoulsy used)

This will open a list of the SMTP servers you have set up for sending mail. Click on the "Gmail" one and then click on "Advanced".

Set Authentication to "Password" enter your Google user name then the app-specific password you generated in the password field.

This should now work until you revoke the password.