diff --git a/repositories/request.go b/repositories/request.go index 0d88dda..011f015 100644 --- a/repositories/request.go +++ b/repositories/request.go @@ -165,12 +165,13 @@ func (r *RequestRepo) sendConfirmationMail(request models.Request) error { message.SetBodyString(mail.TypeTextPlain, messageText.String()) var options []mail.Option + options = append(options, mail.WithPort(r.config.Mailer.SmtpPort)) if r.config.Mailer.SmtpUseAuth { options = append(options, mail.WithSMTPAuth(mail.SMTPAuthPlain)) options = append(options, mail.WithUsername(r.config.Mailer.SmtpIdentity)) options = append(options, mail.WithPassword(r.config.Mailer.SmtpPassword)) } - client, err := mail.NewClient(r.config.Mailer.SmtpHost, mail.WithPort(r.config.Mailer.SmtpPort)) + client, err := mail.NewClient(r.config.Mailer.SmtpHost, options...) if err != nil { log.Println(err.Error()) return err