https://github.com/iradukunda1/email-client
email client based gmail as smtp server
https://github.com/iradukunda1/email-client
go golang http smtp-mail
Last synced: 2 months ago
JSON representation
email client based gmail as smtp server
- Host: GitHub
- URL: https://github.com/iradukunda1/email-client
- Owner: iradukunda1
- Created: 2021-11-29T10:53:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-17T13:48:51.000Z (about 4 years ago)
- Last Synced: 2024-06-20T01:56:35.990Z (almost 2 years ago)
- Topics: go, golang, http, smtp-mail
- Language: Go
- Homepage: https://pkg.go.dev/github.com/iradukunda1/email-client
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README



[](https://codecov.io/gh/iradukunda1/email-client)
# email-client
The email-client Implement send email based on gmail protocol
### Usage
Run the following command to install the package
```
go get github.com/iradukunda1/email-client@latest
```
```bash
type config struct{
Host: "smtp.gmail.com",
Port: "587",
Sender: "your-email@gmail.com",
Secret: "******************" // your gmail password,
}
// descructuring our config you dont pass it directly
configs := email.Config{
Host: config.Host,
Port: config.Port,
Sender: config.Sender,
Secret: config.Secret,
}
services := email.New(configs)
msg := email.Email{
Subject: "Testing",
Body: fmt.Sprintf("This is a test email \n Again test email"),
Recipients: []string{"receiver@gmail.com"},
}
if err := services.Send(msg); err !=nil{
fmt.Printf("error: %v", err)
}
```