mirror of
https://github.com/iLoveElysia/openbilibili.git
synced 2026-09-03 08:08:04 -05:00
18 lines
342 B
Go
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
|
||
|
|
}
|