package email import ( "net/smtp" "testing" ) func TestEmail(*testing.T) { e := NewEmail() e.From = "Jordan Wright " e.To = []string{"test@example.com"} e.Bcc = []string{"test_bcc@example.com"} e.Cc = []string{"test_cc@example.com"} e.Subject = "Awesome Subject" e.Text = "Text Body is, of course, supported!" e.Html = "

Fancy Html is supported, too!

" } func ExampleGmail() { e := NewEmail() e.From = "Jordan Wright " e.To = []string{"test@example.com"} e.Bcc = []string{"test_bcc@example.com"} e.Cc = []string{"test_cc@example.com"} e.Subject = "Awesome Subject" e.Text = "Text Body is, of course, supported!" e.Html = "

Fancy Html is supported, too!

" e.Send("smtp.gmail.com:587", smtp.PlainAuth("", e.From, "password123", "smtp.gmail.com")) } func ExampleAttach() { e := NewEmail() e.Attach("test.txt") }