mail_test.go 365 B

1234567891011121314151617181920212223
  1. package mail
  2. import (
  3. "testing"
  4. )
  5. func TestSend(t *testing.T) {
  6. options := &Options{
  7. MailHost: "smtp.163.com",
  8. MailPort: 465,
  9. MailUser: "xxx@163.com",
  10. MailPass: "", //密码或授权码
  11. MailTo: "",
  12. Subject: "subject",
  13. Body: "body",
  14. }
  15. err := Send(options)
  16. if err != nil {
  17. t.Error("Mail Send error", err)
  18. return
  19. }
  20. t.Log("success")
  21. }