mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-23 02:50:39 +01:00
Fix for msgwriter.go
This commit is contained in:
parent
3c9944cf41
commit
fd04243ebf
1 changed files with 10 additions and 4 deletions
14
msgwriter.go
14
msgwriter.go
|
@ -101,11 +101,17 @@ func (mw *msgWriter) newPart(h map[string][]string) {
|
|||
|
||||
// writePart writes the corresponding part to the Msg body
|
||||
func (mw *msgWriter) writePart(p *Part, cs Charset) {
|
||||
mh := textproto.MIMEHeader{}
|
||||
mh.Add(string(HeaderContentType), fmt.Sprintf("%s; charset=%s",
|
||||
p.ctype, cs))
|
||||
mh.Add(string(HeaderContentTransferEnc), string(p.enc))
|
||||
ct := fmt.Sprintf("%s; charset=%s", p.ctype, cs)
|
||||
cte := fmt.Sprintf("%s", p.enc)
|
||||
if mw.d == 0 {
|
||||
mw.writeHeader(HeaderContentType, ct)
|
||||
mw.writeHeader(HeaderContentTransferEnc, cte)
|
||||
mw.writeString("\r\n")
|
||||
}
|
||||
if mw.d > 0 {
|
||||
mh := textproto.MIMEHeader{}
|
||||
mh.Add(string(HeaderContentType), ct)
|
||||
mh.Add(string(HeaderContentTransferEnc), cte)
|
||||
mw.newPart(mh)
|
||||
}
|
||||
mw.writeBody(p.w, p.enc)
|
||||
|
|
Loading…
Reference in a new issue