Update mail.go
This commit is contained in:
+7
-3
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
@@ -85,10 +86,13 @@ func (m *Mail) SetupMailer() {
|
|||||||
m.SMTPServer.Port = m.Port
|
m.SMTPServer.Port = m.Port
|
||||||
m.SMTPServer.Username = m.Username
|
m.SMTPServer.Username = m.Username
|
||||||
m.SMTPServer.Password = m.Password
|
m.SMTPServer.Password = m.Password
|
||||||
if m.Encryption == "tls" {
|
switch strings.ToLower(strings.ReplaceAll(m.Encryption, "/", "")) {
|
||||||
m.SMTPServer.Encryption = mail.EncryptionTLS
|
case "ssl", "ssltls":
|
||||||
} else {
|
|
||||||
m.SMTPServer.Encryption = mail.EncryptionSSL
|
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
|
// Configuración de tiempo y conexión
|
||||||
|
|||||||
Reference in New Issue
Block a user