Skip to content

Commit d589949

Browse files
committed
Fixed smtp headers
1 parent 072b7be commit d589949

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/smtp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (m *smtpClient) bytes(t *mail.Transmission) []byte {
9696
buf := bytes.NewBuffer(nil)
9797

9898
for k, v := range t.Headers {
99-
buf.WriteString(fmt.Sprintf("%s: %s", k, v))
99+
buf.WriteString(fmt.Sprintf("%s: %s\n", k, v))
100100
}
101101

102102
buf.WriteString("MIME-Version: 1.0\n")

tests/mail_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func GetTransmission(t *testing.T) *mail.Transmission {
7070
Subject: "Test - Go Mail",
7171
HTML: "<h1>Hello from Go Mail!</h1>",
7272
PlainText: "Hello from Go Mail!",
73+
Headers: map[string]string{
74+
"X-Go-Mail": "Test",
75+
},
7376
Attachments: []mail.Attachment{
7477
{
7578
Filename: "gopher.png",

0 commit comments

Comments
 (0)