Description

NewMessage creates a new message. It uses UTF-8 and quoted-printable encoding by default.

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]")

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

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

NewMessage is referenced in 5 repositories

github.com/go-gomail/gomail github.com/aiwuTech/devKit github.com/barrongineer/contest-entry

...