View definition

(*Message).SetAddressHeader

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

Description

SetAddressHeader sets an address to the given header field.

Examples

func TestMessage(t *testing.T) {
	m := NewMessage()
	m.SetAddressHeader("From", "[email protected]", "Señor From")
	m.SetHeader("To", m.FormatAddress("[email protected]", "Señor To"), "[email protected]")
	m.SetAddressHeader("Cc", "[email protected]", "A, B")

	m.SetAddressHeader("From", "[email protected]", "Señor From")
	m.SetHeader("To", m.FormatAddress("[email protected]", "Señor To"), "[email protected]")
	m.SetAddressHeader("Cc", "[email protected]", "A, B")
	m.SetAddressHeader("X-To", "[email protected]", "à, b")
	m.SetDateHeader("X-Date", now())

	m.SetHeader("To", m.FormatAddress("[email protected]", "Señor To"), "[email protected]")
	m.SetAddressHeader("Cc", "[email protected]", "A, B")
	m.SetAddressHeader("X-To", "[email protected]", "à, b")
	m.SetDateHeader("X-Date", now())
	m.SetHeader("X-Date-2", m.FormatDate(now()))

SetAddressHeader is referenced in 2 repositories

github.com/go-gomail/gomail github.com/aiwuTech/devKit