accounts and email
This commit is contained in:
@@ -40,10 +40,10 @@ func (s *SMTPSender) Send(ctx context.Context, to []string, subject, body string
|
||||
return fmt.Errorf("email host not configured")
|
||||
}
|
||||
addr := fmt.Sprintf("%s:%d", s.cfg.Host, s.cfg.Port)
|
||||
msg := []byte(fmt.Sprintf("To: %s\r\nSubject: %s\r\n\r\n%s\r\n", to[0], subject, body))
|
||||
|
||||
msg := []byte(fmt.Sprintf("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s\r\n", s.cfg.From, to[0], subject, body))
|
||||
|
||||
s.logger.Info("sending email", "to", to, "subject", subject, "addr", addr)
|
||||
|
||||
|
||||
// Use SMTP without auth for local testing (Mailpit/MailHog)
|
||||
var auth smtp.Auth
|
||||
err := smtp.SendMail(addr, auth, s.cfg.From, to, msg)
|
||||
|
||||
Reference in New Issue
Block a user