Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
This is a problem for various applications including git send-email
. sendgmail
is tool from Google written in go which allows to use OAuth2 credentials.
Using sendgmail
requires certain configuration in Google Cloud, download JSON with configuration and rename to ~/.sendgmail.json
and then run once:
$ GOPATH/bin/sendgmail [email protected] -setup
1. Ensure that you are logged in as [email protected] in your browser.
2. Open the following link and authorise sendgmail:
https://accounts.google.com/o/oauth2/auth?...
3. Enter the authorisation code:
My ~/.sendgmail.json
contains redirect_uris":["http://localhost"]
, therefore clicked website is redirected to localhost (no webserver is on my machine) and I don't get the authorisation code. Could anybody explain what exactly to do in Google Cloud setup to get it working?
If "Less secure app access" is turned off for your account, you can turn it back on. We recommend switching to more secure apps instead.
I still use gmail as an smtp server. Google complains about it sometimes, but as long as you use it regularly, it seems to work for me5.7.8 Username and Password not accepted. Learn more at https://support.google.com/mail/?p=BadCredentials
.