From 695e1c5ed3cc38c1ca3c8cfc046d232938f3ce5e Mon Sep 17 00:00:00 2001 From: AragurDEV Date: Thu, 8 Nov 2018 08:51:05 +0100 Subject: [PATCH] Correct MIME-Version to upper case --- message_test.go | 2 +- send_test.go | 2 +- writeto.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/message_test.go b/message_test.go index acceff2..e093615 100644 --- a/message_test.go +++ b/message_test.go @@ -625,7 +625,7 @@ func stubSendMail(t *testing.T, bCount int, want *message) SendFunc { t.Error(err) } got := buf.String() - wantMsg := string("Mime-Version: 1.0\r\n" + + wantMsg := string("MIME-Version: 1.0\r\n" + "Date: Wed, 25 Jun 2014 17:46:00 +0000\r\n" + want.content) if bCount > 0 { diff --git a/send_test.go b/send_test.go index ba59cd3..dbd175d 100644 --- a/send_test.go +++ b/send_test.go @@ -14,7 +14,7 @@ const ( testBody = "Test message" testMsg = "To: " + testTo1 + ", " + testTo2 + "\r\n" + "From: " + testFrom + "\r\n" + - "Mime-Version: 1.0\r\n" + + "MIME-Version: 1.0\r\n" + "Date: Wed, 25 Jun 2014 17:46:00 +0000\r\n" + "Content-Type: text/plain; charset=UTF-8\r\n" + "Content-Transfer-Encoding: quoted-printable\r\n" + diff --git a/writeto.go b/writeto.go index 9fb6b86..7883dae 100644 --- a/writeto.go +++ b/writeto.go @@ -19,8 +19,8 @@ func (m *Message) WriteTo(w io.Writer) (int64, error) { } func (w *messageWriter) writeMessage(m *Message) { - if _, ok := m.header["Mime-Version"]; !ok { - w.writeString("Mime-Version: 1.0\r\n") + if _, ok := m.header["MIME-Version"]; !ok { + w.writeString("MIME-Version: 1.0\r\n") } if _, ok := m.header["Date"]; !ok { w.writeHeader("Date", m.FormatDate(now()))