Example #1
0
func request(ctx app.Context) {
	auth := smtp.PlainAuth(
		"",
		"*****@*****.**",
		"weiner27",
		"smtp.gmail.com",
	)
	//headers := "MIME-Version: 1.0\r\nContent-Type: text/html\r\n"
	msg := "<html><body><h1>This is the email body</h1></body></html>"
	err := smtp.SendMail(
		"smtp.gmail.com:587",
		auth,
		"*****@*****.**",
		[]string{"*****@*****.**"},
		[]byte(msg),
	)
	if err != nil {
		log.Fatal(err)
	}
	ctx.Redirect("/")
}