email/example/email_test.go
2025-06-18 18:34:51 +08:00

21 lines
361 B
Go

package email
import (
"strings"
"testing"
"qoobing.com/gomod/email"
)
func TestAttachment(t *testing.T) {
m := email.NewMessage("Hi", "this is the body")
if err := m.AttachBuffer("test.ics", []byte("test"), false); err != nil {
t.Fatal(err)
}
if strings.Contains(string(m.Bytes()), "text/calendar") == false {
t.Fatal("Issue with mailer")
}
}