A small project that collects various nice things to get started with Go Web Development.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
546 B

package main
import (
"MY/webapp/config"
email "MY/webapp/common/email"
"fmt"
"context"
)
func main() {
config.Load("config.json")
ctx := context.Background()
msg := email.EmailMessage{
To: "tina.recip@example.com",
From: "toni.sender@example.com",
Subject: "This is my first mail.",
Text: fmt.Sprintf("Random number %v", 200),
HTML: fmt.Sprintf("<h1>Random number %v</h1>", 200),
}
sender := email.NewSender(ctx)
defer sender.Close()
err := sender.QueueEmail(msg)
if err != nil { panic(err) }
}