Example #1
0
func request(ctx app.Context) {
	auth := smtp.PlainAuth(
		"",
		"[email protected]",
		"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,
		"[email protected]",
		[]string{"[email protected]"},
		[]byte(msg),
	)
	if err != nil {
		log.Fatal(err)
	}
	ctx.Redirect("/")
}
Example #2
0
func index(ctx app.Context) {
	ctx.Show("html/index")
}