feat: refactor the code in NewSmtpEmailProvider() (#3832)

This commit is contained in:
Khanbala Rashidov
2025-05-26 16:23:47 +04:00
committed by GitHub
parent 8b4637aa3a
commit b6b77da7cf

View File

@ -27,8 +27,7 @@ type SmtpEmailProvider struct {
} }
func NewSmtpEmailProvider(userName string, password string, host string, port int, typ string, disableSsl bool) *SmtpEmailProvider { func NewSmtpEmailProvider(userName string, password string, host string, port int, typ string, disableSsl bool) *SmtpEmailProvider {
dialer := &gomail.Dialer{} dialer := gomail.NewDialer(host, port, userName, password)
dialer = gomail.NewDialer(host, port, userName, password)
if typ == "SUBMAIL" { if typ == "SUBMAIL" {
dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true} dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
} }