feat: able to set smtp ssl

This commit is contained in:
CaIon
2024-03-28 12:18:11 +08:00
parent ce7cbccfef
commit 41a2619e84
4 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ func SendEmail(subject string, receiver string, content string) error {
addr := fmt.Sprintf("%s:%d", SMTPServer, SMTPPort)
to := strings.Split(receiver, ";")
var err error
if SMTPPort == 465 {
if SMTPPort == 465 || SMTPSSLEnabled {
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
ServerName: SMTPServer,