Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package dao
import (
"go-common/library/log"
"gopkg.in/gomail.v2"
)
func (d *Dao) SendEmail(subject string, to string, body string) (err error) {
msg := gomail.NewMessage()
msg.SetHeader("From", d.c.Mail.Username)
msg.SetHeader("To", to)
msg.SetHeader("Subject", subject)
msg.SetBody("text/plain", body)
if err = d.email.DialAndSend(msg); err != nil {
log.Error("s.email.DialAndSend error(%v)", err)
return
}
return
}