https://github.com/t4ke0/gmail
gmail library, send emails using your gmail credentials. `gmail app password`
https://github.com/t4ke0/gmail
email gmail golang
Last synced: 6 months ago
JSON representation
gmail library, send emails using your gmail credentials. `gmail app password`
- Host: GitHub
- URL: https://github.com/t4ke0/gmail
- Owner: t4ke0
- License: mit
- Created: 2022-01-22T12:06:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-25T16:05:35.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T13:33:21.923Z (about 2 years ago)
- Topics: email, gmail, golang
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gmail
library for sending email using gmail credentials.
## Usage
```go
package main
import (
...
"github.com/t4ke0/gmail"
...
)
func main() {
username := os.Getenv("GMAIL_USERNAME")
password := os.Getenv("GMAIL_PASSWORD")
em := gmail.NewEmail(username, password, gmail.EmailConfig{
From: username,
To: []string{""}, // put your recipients here
Subject: "", // subject here
MessageText: "", // text body message
Attachements: []string{}, // files attachments here.
})
if err := em.Marshal().Send().Error(); err != nil {
log.Fatal(err)
}
}
```