go-common/app/admin/ep/melloi/dao/mail.go
2019-04-22 18:49:16 +08:00

18 lines
342 B
Go

package dao
import (
"go-common/library/log"
"gopkg.in/gomail.v2"
)
// SendMail asynchronous send mail.
func (d *Dao) SendMail(message *gomail.Message) (err error) {
message.SetAddressHeader("From", d.email.Username, "melloi")
err = d.email.DialAndSend(message)
if err != nil {
log.Error("send email error :(%v)", err)
}
return
}