Clone the repo
go mod download
.env.example
file and paste it as .env
in the same path.env
file Add your email and password and leave other values as it isEMAIL_TO
in which you want to receive your test emailCLIENT_ID
, CLIENT_SECRET
, ACCESS_TOKEN
and REFRESH_TOKEN
follow my medium article Sending Emails with GO (Golang) Using SMTP, Gmail, and OAuth2
go run main.go SMTP
go run main.go OAUTH
NOTE: Environment variables must be filled properly to be able to execute above commands