View definition

(*Message).SetHeaders

Defined in github.com/go-gomail/gomail/message.go

Description

SetHeaders sets the message headers.

Examples

	m.SetHeader("X-Date-2", m.FormatDate(now()))
	m.SetHeader("Subject", "¡Hola, señor!")
	m.SetHeaders(map[string][]string{
		"X-Headers": {"Test", "Café"},
	})

func TestCustomMessage(t *testing.T) {
	m := NewMessage(SetCharset("ISO-8859-1"), SetEncoding(Base64))
	m.SetHeaders(map[string][]string{
		"From":    {"[email protected]"},
		"To":      {"[email protected]"},

func TestUnencodedMessage(t *testing.T) {
	m := NewMessage(SetEncoding(Unencoded))
	m.SetHeaders(map[string][]string{
		"From":    {"[email protected]"},
		"To":      {"[email protected]"},

SetHeaders is referenced in 1 repository

github.com/go-gomail/gomail