- Go to https://myaccount.google.com/lesssecureapps and temporarily enable ‘Less secure app access’. You can enable it immediately after.
- Invoke from the command-like:
$ DISPLAY_NAME="Full name" USERNAME="[email protected]" PASSWORD="password" go run gmail.go