feat: development compose file;
fix: smtp service
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user