Gomail
Example go project to send email using GO via smtp, Gmail API and OAuth2. This is also a reference project for my article in medium titled "Sending Emails with GO (Golang) Using SMTP, Gmail, and OAuth2"
Install / Use
/learn @BinodKafle/GomailREADME
How to use this project
Clone the repo
Download project dependencies
go mod download
Setting up environment
- Copy
.env.examplefile and paste it as.envin the same path - In
.envfile Add your email and password and leave other values as it is - Add your email address in
EMAIL_TOin which you want to receive your test email - For using OAUTH2 to send email and filling up environment variables
CLIENT_ID,CLIENT_SECRET,ACCESS_TOKENandREFRESH_TOKENfollow my medium article Sending Emails with GO (Golang) Using SMTP, Gmail, and OAuth2
Sending email
- For sending test email using SMTP, execute following command
go run main.go SMTP
- For sending test email using Gmail API and OAUTH2, execute following command
go run main.go OAUTH
NOTE: Environment variables must be filled properly to be able to execute above commands
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
350.8kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
