Skip to content

Commit

Permalink
[UPDATE] Changed the smtp insecure env
Browse files Browse the repository at this point in the history
  • Loading branch information
moohbr committed Sep 20, 2022
1 parent 24b243b commit c0aae58
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/providers/mail/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c0aae58

Please # to comment.