mail.go 319 B

123456789101112131415161718
  1. package service
  2. import (
  3. "gopkg.in/gomail.v2"
  4. )
  5. // SendMail send email
  6. func (s *Service) SendMail(receiver string, subject string, content string) error {
  7. var (
  8. m = gomail.NewMessage()
  9. )
  10. m.SetHeader("To", receiver)
  11. m.SetHeader("Subject", subject)
  12. m.SetBody("text/html", content)
  13. return s.dao.SendMail(m)
  14. }