You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
433 B
26 lines
433 B
package email |
|
|
|
import ( |
|
"crypto/tls" |
|
|
|
"go-common/app/job/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 |
|
}
|
|
|