File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ func (m *smtpClient) bytes(t *mail.Transmission) []byte {
107
107
if t .HasAttachments () {
108
108
buf .WriteString (fmt .Sprintf ("Content-Type: multipart/alternative; boundary=%s\r \n " , boundary ))
109
109
} else {
110
- buf .WriteString ("Content-Type: text/html; charset=UTF-8\r \n " )
110
+ buf .WriteString (fmt . Sprintf ( "Content-Type: text/html; charset=UTF-8; boundary=%s \r \n " , boundary ) )
111
111
}
112
112
113
113
buf .WriteString (fmt .Sprintf ("Subject: %s\n " , t .Subject ))
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ package drivers
15
15
16
16
import (
17
17
"errors"
18
+ "fmt"
18
19
"github.com/ainsleyclark/go-mail/mail"
19
20
"net/smtp"
20
21
)
@@ -131,3 +132,22 @@ func (t *DriversTestSuite) TestSMTP_Send() {
131
132
})
132
133
}
133
134
}
135
+
136
+ func (t * DriversTestSuite ) TestSMTP_Bytes () {
137
+ t .T ().Skip ()
138
+
139
+ m := smtpClient {}
140
+ got := m .bytes (& mail.Transmission {
141
+ Recipients : []string {"hello@gmail.com" },
142
+ Subject : "Subject" ,
143
+ HTML : "<h1>Hey!</h1>" ,
144
+ PlainText : "Hey!" ,
145
+ //Attachments: []mail.Attachment{
146
+ // {
147
+ // Filename: "test.jpg",
148
+ // Bytes: []byte("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg=="),
149
+ // },
150
+ //},
151
+ })
152
+ fmt .Println (string (got ))
153
+ }
You can’t perform that action at this time.
0 commit comments