email.go 254 B

123456789101112
  1. package dao
  2. import (
  3. gomail "gopkg.in/gomail.v2"
  4. )
  5. // SendMail asynchronous send mail.
  6. func (d *Dao) SendMail(message *gomail.Message) (err error) {
  7. message.SetAddressHeader("From", d.c.Mail.From, "bbq")
  8. err = d.email.DialAndSend(message)
  9. return
  10. }