go-gmail is an up-and-coming GMail library in Golang. For now it only supports sending e-mail using authenticated SMTP.
Assuming you have a working Go environment, installation is simple:
go get github.com/njern/gogmail
You can take a look at the documentation locally with:
godoc github.com/njern/gogmail
The included tests in gogmail_test.go
also illustrate usage of the package.
Note: You must enter a valid GMail address / password in gogmail_test.go
or the tests will fail!
For obvious reasons I did not leave my own address / password in the test file... :)
import "github.com/njern/gogmail"
import "log"
gmail := gogmail.GmailConnection("[email protected]", "my_password")
err := gmail.SendMail([]string{"[email protected]"}, "Hello go-gmail!", "Looks like go-gmail is working just fine!")
if err != nil {
log.Fatal("Sending a GMail e-mail failed with error: ", err)
}
- Support for retrieving e-mail, folders, etc etc
- Let me know if you're using go-gmail by dropping me a line at [github user name] at walkbase.com
- Let me know about any bugs / annoyances the same way