https://github.com/fmorenovr/gomail
GoMail is a SMTP library implemented in golang.
https://github.com/fmorenovr/gomail
go go-smtp golang gomail mail smtp smtp-client smtp-go smtp-mail
Last synced: 5 months ago
JSON representation
GoMail is a SMTP library implemented in golang.
- Host: GitHub
- URL: https://github.com/fmorenovr/gomail
- Owner: fmorenovr
- License: mit
- Created: 2018-04-10T22:28:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T17:40:02.000Z (almost 7 years ago)
- Last Synced: 2025-08-03T00:06:59.933Z (10 months ago)
- Topics: go, go-smtp, golang, gomail, mail, smtp, smtp-client, smtp-go, smtp-mail
- Language: Go
- Homepage: https://godoc.org/github.com/fmorenovr/gomail
- Size: 16.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# golang + Mail = GoMail (Gomail)
goMail (Golang for SMTP) is a Golang implementation for Simple Mail Transfer Protocol service.
You can see an extended doc in [godocs](https://godoc.org/github.com/fmorenovr/goMail).
## SMTP
SMTP is a protocol that you can send secure text messages trough the internet.
See more info [here](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol).
## goMail
* First, You should download my library:
go get github.com/fmorenovr/gomail/
* Then, you should use for differents implements in Go.
* First, Create a gomail object:
gomailObject := gomail.NewGomail()
// credentials
gomailObject.Set("Username", "aduncus@gomail.com")
gomailObject.Set("Password", "********")
// servername
gomailObject.Set("Servername", "smtp.gmail.com:465")
// from
gomailObject.Set("From", "example@gomail.com")
gomailObject.Set("From_name", "gomail Service")
// to
gomailObject.Set("To", "person1@gomail.com")
gomailObject.Set("To_name", "Person 1")
// subject
gomailObject.Set("Subject", "This is the email subject")
// body message
gomailObject.Set("BodyMessage", "This is the fabulous body message\n\nGood Luck!!")
* Finally, send a message:
err := gomailObject.SendMessage()
fmt.Println("Error: ", err)