Skip to content

Commit

Permalink
I we can't make the smtp connection then it might be a good idea to c…
Browse files Browse the repository at this point in the history
…heck client != nil :)
  • Loading branch information
Siposattila committed May 29, 2024
1 parent af07f3e commit fa6311f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/email/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ func (e *Email) verifyEmail() uint8 {
return interfaces.EMAIL_INVALID
}

client, _ := smtp.NewClient(connection, mxHost)
client, err := smtp.NewClient(connection, mxHost)
if err != nil {
logger.LogError(err)

return interfaces.EMAIL_INVALID
}

client.Hello("gobulk.com")
client.Mail("info@gobulk.com")
rcptErr := client.Rcpt(e.Email)
Expand Down

0 comments on commit fa6311f

Please sign in to comment.