smtp_test.go 345 B

12345678910111213141516
  1. package utl
  2. import "testing"
  3. func TestSmtp_Send(t *testing.T) {
  4. smtp := NewSmtp("smtp.163.com", 465, "yyk882002@163.com", "3#initialize", "wen.studio")
  5. body := `
  6. <h1>hello</h1>
  7. <div color="red">
  8. this is send from 163.com
  9. </div>
  10. `
  11. err := smtp.Send([]string{"wedtrav@foxmail.com"}, "hello", body)
  12. AssertNil(err, "send mail", t)
  13. }