Gmail SMTP and Two Factor Authentication For using Google SMTP of accounts that has two factor authentication enabled, fist an app needs to be created and then the app password will have to be used in the application that will be sending the emails.