go-common/app/admin/main/up/dao/email/dao.go

27 lines
435 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package email
import (
"crypto/tls"
"go-common/app/admin/main/up/conf"
gomail "gopkg.in/gomail.v2"
)
// Dao is redis dao.
type Dao struct {
email *gomail.Dialer
}
// New is new redis dao.
func New(c *conf.Config) (d *Dao) {
d = &Dao{
// mail
email: gomail.NewDialer(c.MailConf.Host, c.MailConf.Port, c.MailConf.Username, c.MailConf.Password),
}
d.email.TLSConfig = &tls.Config{
InsecureSkipVerify: true,
}
return
}