add required date header
This commit is contained in:
parent
237b141738
commit
69e2778b3d
8
main.go
8
main.go
|
@ -7,13 +7,13 @@ import (
|
||||||
"encoding/base32"
|
"encoding/base32"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/jmoiron/sqlx"
|
||||||
|
"golang.org/x/crypto/bcrypt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
"github.com/jmoiron/sqlx"
|
|
||||||
"golang.org/x/crypto/bcrypt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type templates struct {
|
type templates struct {
|
||||||
|
@ -467,10 +467,12 @@ func SendMail(addr, from, subject, body string, to string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
date := time.Now()
|
||||||
msg := "To: " + to + "\r\n" +
|
msg := "To: " + to + "\r\n" +
|
||||||
"From: " + from + "\r\n" +
|
"From: " + from + "\r\n" +
|
||||||
"Subject: " + subject + "\r\n" +
|
"Subject: " + subject + "\r\n" +
|
||||||
"Content-Type: text/html; charset=\"UTF-8\"\r\n" +
|
"Content-Type: text/html; charset=\"UTF-8\"\r\n" +
|
||||||
|
"Date: " + date.Format(time.RFC1123Z) + "\r\n" +
|
||||||
"\r\n" + body
|
"\r\n" + body
|
||||||
|
|
||||||
_, err = w.Write([]byte(msg))
|
_, err = w.Write([]byte(msg))
|
||||||
|
|
Loading…
Reference in New Issue