...
1
9
10 package main
11
12 import (
13 "gitlab.hexacode.org/go-libs/hctypes"
14 "gitlab.hexacode.org/go-libs/mailer"
15 )
16
17 func main() {
18
19
20 tmpl, err := mailer.NewTemplate("Hello {{ name }}!")
21 if err != nil {
22 panic(err)
23 }
24
25
26 sender := mailer.NewSender("Example Sender", "example-sender@gmail.com", "password", "smtp.gmail.com", 587, tmpl)
27
28
29 err = sender.SendEmail("example-recipient@gmail.com", "Example Subject", hctypes.Dict{"name": "John Doe"})
30 if err != nil {
31 panic(err)
32 }
33 }
34
View as plain text