Fixing build

This commit is contained in:
=Corey Hulen
2015-06-16 23:05:37 -08:00
parent c2f6e6a10d
commit db2510554a
2 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
"ServiceSettings": {
"SiteName": "Mattermost Preview",
"Domain": "",
"Mode" : "prod",
"Mode" : "dev",
"AllowTesting" : false,
"UseSSL": false,
"Port": "8065",
+10 -6
View File
@@ -40,23 +40,27 @@ func SendMail(to, subject, body string) *model.AppError {
auth := smtp.PlainAuth("", Cfg.EmailSettings.SMTPUsername, Cfg.EmailSettings.SMTPPassword, host)
var conn net.Conn
var err error
if Cfg.EmailSettings.UseTLS {
tlsconfig := &tls.Config{
InsecureSkipVerify: true,
ServerName: host,
}
conn, err := tls.Dial("tcp", Cfg.EmailSettings.SMTPServer, tlsconfig)
conn, err = tls.Dial("tcp", Cfg.EmailSettings.SMTPServer, tlsconfig)
if err != nil {
return model.NewAppError("SendMail", "Failed to open TLS connection", err.Error())
}
defer conn.Close()
} else {
conn, err = net.Dial("tcp", Cfg.EmailSettings.SMTPServer)
if err != nil {
return model.NewAppError("SendMail", "Failed to open connection", err.Error())
}
}
conn, err := net.Dial("tcp", Cfg.EmailSettings.SMTPServer)
if err != nil {
return model.NewAppError("SendMail", "Failed to open connection", err.Error())
}
defer conn.Close()
c, err := smtp.NewClient(conn, host)
if err != nil {