Update mail.go

This commit is contained in:
Lizandro Guarnizo
2026-05-12 18:57:17 -05:00
parent 05141ce70e
commit 55c68b470b
+7 -3
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"log"
"os"
"strings"
"time"
"github.com/gofiber/fiber/v2"
@@ -85,10 +86,13 @@ func (m *Mail) SetupMailer() {
m.SMTPServer.Port = m.Port
m.SMTPServer.Username = m.Username
m.SMTPServer.Password = m.Password
if m.Encryption == "tls" {
m.SMTPServer.Encryption = mail.EncryptionTLS
} else {
switch strings.ToLower(strings.ReplaceAll(m.Encryption, "/", "")) {
case "ssl", "ssltls":
m.SMTPServer.Encryption = mail.EncryptionSSL
case "tls", "starttls":
m.SMTPServer.Encryption = mail.EncryptionSTARTTLS
default:
m.SMTPServer.Encryption = mail.EncryptionNone
}
// Configuración de tiempo y conexión