In Google Mail, you must allow "less secure" apps access in order for your SMTP settings to work. There are two places this setting must be enabled:
- The first is here: https://myaccount.google.com/ under “Connected apps & sites.”
- The other is here: https://www.google.com/settings/security/lesssecureapps
Once enabled in both places, you're good to go!
Please note that these options are not available if you have two-factor authentication (2FA) enabled for your Google account. Instead of using SMTP, you will need to connect your mailbox to Google via OAuth if you are using 2FA.