How To Generate A Gmail App Specific Password
The two-factor authentication feature in Gmail requires a special security code when you access your account from a new device. However, some programs, apps, or devices can't send a two-factor challenge response. The App specific password may solve this problem.
You don't have to use the App password to use Gmail 2 step verification if you have iOS 8.3 or greater on your iPhone or OSX 10.10.3 or greater on your Mac.
How to generate a Gmail app specific password
Step 1: Log into your Gmail account.
Step 2: Go to your App passwords page.
Step 3: Enter your password and click Next to verify your identity.
Step 4: Enter a verification code which has just been sent to your phone number via a text message then click Next.
Step 5: Click Select app and select Mail from the drop-down menu.
Step 6: Click Select device and select the device you want to generate the app password for then click Generate.
Step 6: Follow the on-screen instructions to generate the app password (the code in the yellow bar) on your device.
Note: You only need to enter that code once, so don't worry about memorizing it. You can always generate a new App password whenever you need one.
Step 7: Select Done.
Once finished, you will see a list of apps and devices that you've created App passwords for. You can generate as many app passwords as you like.