Commit b8b7c3b111
Verified · cmc
internal/mail/mail.go +2 −1
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | package mail |
| 5 | 5 | |
| 6 | 6 | import ( |
| 7 | "crypto/tls" | |
| 7 | 8 | "fmt" |
| 8 | 9 | "net" |
| 9 | 10 | "net/smtp" |
| @@ -35,7 +36,7 @@ func Send(cfg config.Config, to, subject, body string) error { | ||
| 35 | 36 | } |
| 36 | 37 | defer c.Close() |
| 37 | 38 | if ok, _ := c.Extension("STARTTLS"); ok { |
| 38 | if err := c.StartTLS(nil); err != nil { | |
| 39 | if err := c.StartTLS(&tls.Config{ServerName: hostname}); err != nil { | |
| 39 | 40 | return fmt.Errorf("starttls: %w", err) |
| 40 | 41 | } |
| 41 | 42 | } |