using a noreply@companyName or web@companyName email address.
Sign in to your Google Admin console.
Click Security > Basic settings.
Under Less secure apps, select Go to settings for less secure apps.
In the sub-window, select the Allow users to manage their access to less secure apps radio button.
Log into your Magento Store and add the configuration above
As of December 2014, in order to better secure customer’s email account Google has implemented new authentication mechanism called XOAUTH2 based on OAuth2 specification for access to their various services, including Gmail. This change can break both SMTP and IMAP access to Gmail or G-suite, and you may receive various authentication failures (“5.7.14 Please log in via your web browser and then try again” or “Username and Password not accepted”) while testing your configuration from our extension. Included in the error message is a link to https://support.google.com/mail/bin/answer.py?answer=78754, which provide a list of possible causes, or https://support.google.com/mail/?p=BadCredentials, which for the most part does not provide enough information. Currently our smtp extension does not support OAuth2 which would take a lot more time to setup.
For security reasons Gmail does not like unexpected or unfamiliar clients connecting to gmail accounts, so you may require to log into your gmail account from a browser as mentioned in error output, or to visit the CAPTCHA page mentioned in their support doc.
Enabling “Allow less secure apps” will usually solve the problem for our extension, since our recommendation is to use a dedicated email address to send mail it will not make your app significantly less secure. Please note that sometime changing this setting may take an hour or more to take effect.