check smtp configurations

This commit is contained in:
Ulric Qin 2022-03-31 12:02:57 +08:00
parent 16d303a6fb
commit 5d17f006f0
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ func StartEmailSender() {
conf := config.C.SMTP
if conf.Host == "" || conf.Port == 0 {
logger.Warning("SMTP configurations invalid")
return
}
d := gomail.NewDialer(conf.Host, conf.Port, conf.User, conf.Pass)
if conf.InsecureSkipVerify {
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}