common: fix shadowed error in SendEmail()

This commit is contained in:
Lars Lehtonen 2020-02-18 11:16:16 -08:00
parent 584cbad497
commit 080a8fd615
No known key found for this signature in database
GPG Key ID: 8137D474EBCB04F2
1 changed files with 2 additions and 1 deletions

View File

@ -65,12 +65,13 @@ func SendEmail(email, subject, msg string) (err error) {
body += "\r\n" + msg
var c *smtp.Client
var conn *tls.Conn
if Config.SMTPEnableTLS {
tlsconfig := &tls.Config{
InsecureSkipVerify: true,
ServerName: Config.SMTPServer,
}
conn, err := tls.Dial("tcp", Config.SMTPServer+":"+Config.SMTPPort, tlsconfig)
conn, err = tls.Dial("tcp", Config.SMTPServer+":"+Config.SMTPPort, tlsconfig)
if err != nil {
LogWarning(err)
return err