parent
6805982221
commit
c7ca0f5da9
|
@ -144,7 +144,7 @@ func (msg *Message) SetDateHeader(field string, date time.Time) {
|
||||||
|
|
||||||
// FormatDate formats a date as a valid RFC 5322 date.
|
// FormatDate formats a date as a valid RFC 5322 date.
|
||||||
func (msg *Message) FormatDate(date time.Time) string {
|
func (msg *Message) FormatDate(date time.Time) string {
|
||||||
return date.Format(time.RFC822Z)
|
return date.Format(time.RFC1123Z)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHeader gets a header field.
|
// GetHeader gets a header field.
|
||||||
|
|
|
@ -37,8 +37,8 @@ func TestMessage(t *testing.T) {
|
||||||
},
|
},
|
||||||
content: "From: =?UTF-8?Q?Se=C3=B1or_From?= <from@example.com>\r\n" +
|
content: "From: =?UTF-8?Q?Se=C3=B1or_From?= <from@example.com>\r\n" +
|
||||||
"To: =?UTF-8?Q?Se=C3=B1or_To?= <to@example.com>, tobis@example.com\r\n" +
|
"To: =?UTF-8?Q?Se=C3=B1or_To?= <to@example.com>, tobis@example.com\r\n" +
|
||||||
"X-Date: 25 Jun 14 17:46 +0000\r\n" +
|
"X-Date: Wed, 25 Jun 2014 17:46:00 +0000\r\n" +
|
||||||
"X-Date-2: 25 Jun 14 17:46 +0000\r\n" +
|
"X-Date-2: Wed, 25 Jun 2014 17:46:00 +0000\r\n" +
|
||||||
"X-Headers: Test, =?UTF-8?Q?Caf=C3=A9?=\r\n" +
|
"X-Headers: Test, =?UTF-8?Q?Caf=C3=A9?=\r\n" +
|
||||||
"Subject: =?UTF-8?Q?=C2=A1Hola,_se=C3=B1or!?=\r\n" +
|
"Subject: =?UTF-8?Q?=C2=A1Hola,_se=C3=B1or!?=\r\n" +
|
||||||
"Content-Type: text/plain; charset=UTF-8\r\n" +
|
"Content-Type: text/plain; charset=UTF-8\r\n" +
|
||||||
|
@ -528,7 +528,7 @@ func stubSendMail(t *testing.T, bCount int, emails ...message) SendMailFunc {
|
||||||
|
|
||||||
got := string(msg)
|
got := string(msg)
|
||||||
wantMsg := string("Mime-Version: 1.0\r\n" +
|
wantMsg := string("Mime-Version: 1.0\r\n" +
|
||||||
"Date: 25 Jun 14 17:46 +0000\r\n" +
|
"Date: Wed, 25 Jun 2014 17:46:00 +0000\r\n" +
|
||||||
want.content)
|
want.content)
|
||||||
if bCount > 0 {
|
if bCount > 0 {
|
||||||
boundaries := getBoundaries(t, bCount, got)
|
boundaries := getBoundaries(t, bCount, got)
|
||||||
|
|
|
@ -23,7 +23,7 @@ var (
|
||||||
const wantMsg = "To: to1@example.com, to2@example.com\r\n" +
|
const wantMsg = "To: to1@example.com, to2@example.com\r\n" +
|
||||||
"From: from@example.com\r\n" +
|
"From: from@example.com\r\n" +
|
||||||
"Mime-Version: 1.0\r\n" +
|
"Mime-Version: 1.0\r\n" +
|
||||||
"Date: 25 Jun 14 17:46 +0000\r\n" +
|
"Date: Wed, 25 Jun 2014 17:46:00 +0000\r\n" +
|
||||||
"Content-Type: text/plain; charset=UTF-8\r\n" +
|
"Content-Type: text/plain; charset=UTF-8\r\n" +
|
||||||
"Content-Transfer-Encoding: quoted-printable\r\n" +
|
"Content-Transfer-Encoding: quoted-printable\r\n" +
|
||||||
"\r\n" +
|
"\r\n" +
|
||||||
|
|
Loading…
Reference in New Issue