mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 05:40:50 +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
|
// writePart writes the corresponding part to the Msg body
|
||||||
func (mw *msgWriter) writePart(p *Part, cs Charset) {
|
func (mw *msgWriter) writePart(p *Part, cs Charset) {
|
||||||
mh := textproto.MIMEHeader{}
|
ct := fmt.Sprintf("%s; charset=%s", p.ctype, cs)
|
||||||
mh.Add(string(HeaderContentType), fmt.Sprintf("%s; charset=%s",
|
cte := fmt.Sprintf("%s", p.enc)
|
||||||
p.ctype, cs))
|
if mw.d == 0 {
|
||||||
mh.Add(string(HeaderContentTransferEnc), string(p.enc))
|
mw.writeHeader(HeaderContentType, ct)
|
||||||
|
mw.writeHeader(HeaderContentTransferEnc, cte)
|
||||||
|
mw.writeString("\r\n")
|
||||||
|
}
|
||||||
if mw.d > 0 {
|
if mw.d > 0 {
|
||||||
|
mh := textproto.MIMEHeader{}
|
||||||
|
mh.Add(string(HeaderContentType), ct)
|
||||||
|
mh.Add(string(HeaderContentTransferEnc), cte)
|
||||||
mw.newPart(mh)
|
mw.newPart(mh)
|
||||||
}
|
}
|
||||||
mw.writeBody(p.w, p.enc)
|
mw.writeBody(p.w, p.enc)
|
||||||
|
|
Loading…
Reference in a new issue