feat: development compose file;

fix: smtp service
This commit is contained in:
2025-07-10 01:41:54 +03:00
parent 15c140db31
commit f59b647b27
2 changed files with 130 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ func (s *smtpServiceImpl) SendEmail(to string, subject, body string) error {
sb.WriteString("\r\n" + body)
message := []byte(sb.String())
hostPort := fmt.Sprintf("%s:%d", cfg.SmtpServer, cfg.SmtpPort)
hostPort := net.JoinHostPort(cfg.SmtpServer, fmt.Sprintf("%d", cfg.SmtpPort))
var conn net.Conn
var err error
@@ -117,8 +117,8 @@ func (s *smtpServiceImpl) SendEmail(to string, subject, body string) error {
return err
}
for _, recipient := range to {
if err = client.Rcpt(string(recipient)); err != nil {
for _, recipient := range toSlice {
if err = client.Rcpt(recipient); err != nil {
s.log.Error("SMTP recipient set failed", zap.Error(err))
return err
}