diff --git a/.env.example b/.env.example index cae35d2..2bc7664 100644 --- a/.env.example +++ b/.env.example @@ -2,5 +2,4 @@ SMPT_SERVER = "smtp.gmail.com" SMTP_PORT = 465 SMTP_USER = "yourmail@gmail.com" SMTP_PASSWORD = "password" -SMTP_TLS = False -SMTP_SSL = False +SMTP_INSECURE = True diff --git a/README.md b/README.md index 2ba193b..4e871cb 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,7 @@ To run this project, you will need to add the following environment variables to `SMTP_PORT` - SMTP server port `SMTP_USER` - SMTP server user `SMTP_PASSWORD` - SMTP server password -`SMTP_TLS` - SMTP server TLS (true/false) -`SMTP_SSL` - SMTP server SSL (true/false) +`SMTP_INSECURE` - SMTP server insecure ## CLI Arguments diff --git a/src/providers/mail/mail.go b/src/providers/mail/mail.go index a80327f..3dc484f 100644 --- a/src/providers/mail/mail.go +++ b/src/providers/mail/mail.go @@ -32,7 +32,7 @@ func (mail *Mail) Send() error { dialer := gomail.NewDialer(config.GetEnv("SMPT_SERVER"), config.ConvertToInt(config.GetEnv("SMTP_PORT")), config.GetEnv("SMTP_USER"), config.GetEnv("SMTP_PASSWORD")) - dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true} + dialer.TLSConfig = &tls.Config{InsecureSkipVerify: config.ConvertToBool(config.GetEnv("SMTP_INSECURE"))} if err := dialer.DialAndSend(message); err != nil { panic(err)