From 55c68b470b7080780cd6e5f3d22ae8dd3459127a Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 12 May 2026 18:57:17 -0500 Subject: [PATCH] Update mail.go --- config/mail.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/mail.go b/config/mail.go index 54f33e2..885fa44 100755 --- a/config/mail.go +++ b/config/mail.go @@ -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