Q: Add text and table to outlook body I would like to send 3 lines of text and a table in the outlook body via Gomail in Go. The table is created from an array of structs.
This is how I pass the body in.
m.SetBody("text/html", body)

Referencing to this link, Show a table from a slice with my struct Golang, I tried to create a html formatted table. But it creates a html file instead.
var basenameOpts = []Test {
    Test {
        Entity: "a",
        SourceSystem: "multiple",
        Customer : "Usage for a",
    },
    Test{
        Entity: "test",
        SourceSystem: "b-option",
        Customer : "Usage for b",
    },
}
type PageData struct {
    Title string
    Data []Test
}
func MyStructHandler(w http.ResponseWriter, r *http.Request) {
    data := PageData{
        Text: "My Super Awesome Page of Structs./n/n New line./n/n Next line",
        Data: basenameOpts,
        }
        t := template.Must(template.ParseFiles("./showmystruct.html"))
        t.Execute(w, data)
    }

How should I convert the html formatted body in to a string to pass it into m.SetBody?
