# Hexacode Mailer [![GoDoc](https://pkg.go.dev/badge/github.com/gin-gonic/gin?status.svg)](https://docs-go.hexacode.org/pkg/gitlab.hexacode.org/go-libs/mailer/) ## Example ```go package main import ( "gitlab.hexacode.org/go-libs/hctypes" "gitlab.hexacode.org/go-libs/mailer" ) func main() { // Create a new template // Please see https://github.com/noirbizarre/gonja for more details template tmpl, err := mailer.NewTemplate("Hello {{ name }}!") if err != nil { panic(err) } // Create a new sender sender := mailer.NewSender("Example Sender", "example-sender@gmail.com", "password", "smtp.gmail.com", 587, tmpl) // Send an email err = sender.SendEmail("example-recipient@gmail.com", "Example Subject", hctypes.Dict{"name": "John Doe"}) if err != nil { panic(err) } } ```