Fix date header on outgoing emails

This commit is contained in:
Drew DeVault 2019-05-17 11:05:21 -04:00
parent e436780b47
commit 23650ac0c7

View file

@ -221,7 +221,7 @@ func (c *Composer) PrepareHeader() (*mail.Header, []string, error) {
if subject, _ := header.Subject(); subject == "" { if subject, _ := header.Subject(); subject == "" {
header.SetSubject(c.headers.subject.input.String()) header.SetSubject(c.headers.subject.input.String())
} }
if date, err := header.Date(); err != nil && date != (time.Time{}) { if date, err := header.Date(); err != nil || date == (time.Time{}) {
header.SetDate(time.Now()) header.SetDate(time.Now())
} }
if from, _ := mhdr.Text("From"); from == "" { if from, _ := mhdr.Text("From"); from == "" {