1.) Log into your Gmail account and go to https://myaccount.google.com/security?ref=noted
2.) Click on 2-Step Verification. Make sure it’s turned ON.
3.) Scroll down to the bottom of the 2-Step Verification page to "App passwords". Add a new app by clicking on “Select App” then choose “Other (Custom Name)”. Give it a friendly name such as “Honeit-App”.
4.) Click on “Generate” and copy the auto generated password.
You will now be able to use your Gmail through an email client using smtp with the following credentials:
Host: smtp.gmail.com
Port: 587
User: yourgmail@gmail.com
Password: autogeneratedapppassword