mirror of https://github.com/statping/statping
Merge pull request #180 from giner/email_test_respect_ssl_option
notifiers/email: Respect SSL option in Testpull/168/head^2
commit
1060e3c698
|
@ -232,10 +232,12 @@ func (u *email) OnTest() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if u.ApiKey != "true" {
|
||||||
err = dial.StartTLS(&tls.Config{InsecureSkipVerify: true})
|
err = dial.StartTLS(&tls.Config{InsecureSkipVerify: true})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if u.Username != "" || u.Password != "" {
|
if u.Username != "" || u.Password != "" {
|
||||||
auth := smtp.PlainAuth("", u.Username, u.Password, host)
|
auth := smtp.PlainAuth("", u.Username, u.Password, host)
|
||||||
err = dial.Auth(auth)
|
err = dial.Auth(auth)
|
||||||
|
|
Loading…
Reference in New Issue