go-common/app/admin/ep/melloi/dao/mail.go

18 lines
342 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
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
}