fix: Remove InsecureSkipVerify option in TLS config for

email sending.
This commit is contained in:
Laisky.Cai 2023-11-16 02:46:19 +00:00
parent a5a3ca2b81
commit f979181b5f

View File

@ -24,8 +24,8 @@ func SendEmail(subject string, receiver string, content string) error {
var err error
if SMTPPort == 465 {
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
ServerName: SMTPServer,
// InsecureSkipVerify: true,
ServerName: SMTPServer,
}
conn, err := tls.Dial("tcp", fmt.Sprintf("%s:%d", SMTPServer, SMTPPort), tlsConfig)
if err != nil {