For securities reason, the less secure app access option is deprecated and replaced by another service called “App passwords”. It means we can no longer use our Gmail account password to send emails via SMTP; instead, we have to use an application-specific password to send emails through SMTP. This article will show you how to create an app password using the Google App passwords service.
Step 1: If you have never set 2-Step Verification up, App passwords option will not be shown on the Security section of your Google account. Go to the Security section of your google account. Select 2-Step Verification and turn it on.
Step 2: After setting up 2-Step Verification, click the App passwords button. Under the “Select the app and device you want to generate the password for” part, select app as “Mail” and select device as your device name.
Step 3: Jot down the generated password.
You may now try to send an email out with the generated password through SMTP.