gomail

command module
v0.0.0-...-0a05793 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 4 Imported by: 0

README

How to use this project

Clone the repo

Download project dependencies

go mod download

Setting up environment

  • Copy .env.example file and paste it as .env in the same path
  • In .env file Add your email and password and leave other values as it is
  • Add your email address in EMAIL_TO in which you want to receive your test email
  • For using OAUTH2 to send email and filling up environment variables CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN and REFRESH_TOKEN follow 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL