mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-13 14:31:15 +00:00
fix TLS for email sending
This commit is contained in:
@@ -71,9 +71,9 @@ func SendEmailWithAttachments(cfg MailConfig, sender, replyTo, subject, body str
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.CertValidation {
|
||||
return e.Send(hostname, auth)
|
||||
if cfg.TLS {
|
||||
return e.SendWithStartTLS(hostname, auth, &tls.Config{InsecureSkipVerify: !cfg.CertValidation})
|
||||
} else {
|
||||
return e.SendWithStartTLS(hostname, auth, &tls.Config{InsecureSkipVerify: true})
|
||||
return e.Send(hostname, auth)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user