update email and stop on error

This commit is contained in:
shoopea
2022-10-08 10:49:28 +08:00
parent f36e7da824
commit a7ee0bfeb7
3 changed files with 26 additions and 18 deletions

View File

@@ -60,7 +60,8 @@ func SendMail(addr, from, subject, body string, to []string) error {
return err
}
msg := "To: " + strings.Join(to, ",") + "\r\n" +
msg := "Date:" + time.Now().Format("Mon, 02 Jan 2006 15:04:05 -0700") + "\r\n" +
"To: " + strings.Join(to, ",") + "\r\n" +
"From: " + from + "\r\n" +
"Subject: " + subject + "\r\n" +
"Content-Type: text/html; charset=\"UTF-8\"\r\n" +