disable email TLS setting

pull/168/head v0.80.54
hunterlong 2019-04-03 08:34:16 -07:00
parent fba9758290
commit 5e15a7d8da
1 changed files with 12 additions and 1 deletions

View File

@ -149,6 +149,12 @@ var emailer = &email{&notifier.Notification{
Title: "Send Alerts To",
Placeholder: "sendto@email.com",
DbField: "Var2",
}, {
Type: "text",
Title: "Disable TLS/SSL",
Placeholder: "",
SmallText: "To Disable TLS/SSL insert 'true'",
DbField: "api_key",
}},
}}
@ -264,9 +270,14 @@ func (u *email) OnTest() error {
func (u *email) dialSend(email *emailOutgoing) error {
mailer = mail.NewDialer(emailer.Host, emailer.Port, emailer.Username, emailer.Password)
mailer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
emailSource(email)
m := mail.NewMessage()
// if email setting TLS is Disabled
if u.ApiKey == "true" {
mailer.SSL = false
} else {
mailer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
}
m.SetHeader("From", email.From)
m.SetHeader("To", email.To)
m.SetHeader("Subject", email.Subject)