(This accounts area is where you paste in your 'recieving' password under 'incoming mail server'. 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'. Now open Mail and go to Preferences > Accounts and select your Google account.
Go to Google and generate an app-specific password on this page. (Note: There are two locations you must paste you app-specific password, these instructions are for the 'sending' server, not the 'receiving' server')