Merge branch 'feat/1.1.0/smtp-insecure' into feat/1.1.0/report

# Conflicts:
#	internal/service/export/email_service.go
This commit is contained in:
LinkinStars
2023-05-17 10:35:11 +08:00
+5
View File
@@ -1,9 +1,11 @@
package export
import (
"crypto/tls"
"encoding/json"
"fmt"
"mime"
"os"
"time"
"github.com/answerdev/answer/internal/base/constant"
@@ -129,6 +131,9 @@ func (es *EmailService) Send(ctx context.Context, toEmailAddr, subject, body str
if ec.IsSSL() {
d.SSL = true
}
if len(os.Getenv("SKIP_SMTP_TLS_VERIFY")) > 0 {
d.TLSConfig = &tls.Config{ServerName: d.Host, InsecureSkipVerify: true}
}
if err := d.DialAndSend(m); err != nil {
log.Errorf("send email to %s failed: %s", toEmailAddr, err)
} else {