mail.go 342 B

1234567891011121314151617
  1. package dao
  2. import (
  3. "go-common/library/log"
  4. "gopkg.in/gomail.v2"
  5. )
  6. // SendMail asynchronous send mail.
  7. func (d *Dao) SendMail(message *gomail.Message) (err error) {
  8. message.SetAddressHeader("From", d.email.Username, "melloi")
  9. err = d.email.DialAndSend(message)
  10. if err != nil {
  11. log.Error("send email error :(%v)", err)
  12. }
  13. return
  14. }