feat: able to set smtp ssl

This commit is contained in:
CaIon
2024-03-28 12:18:11 +08:00
parent 786ccc7da0
commit 5c39f54040
4 changed files with 16 additions and 2 deletions

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,