diff --git a/parsemail.go b/parsemail.go index 42e0170..6a60192 100644 --- a/parsemail.go +++ b/parsemail.go @@ -249,6 +249,13 @@ func parseMultipartMixed(msg io.Reader, boundary string) (textBody, htmlBody str } textBody += strings.TrimSuffix(string(ppContent[:]), "\n") + } else if contentType == contentTypeTextHtml { + ppContent, err := ioutil.ReadAll(part) + if err != nil { + return textBody, htmlBody, attachments, embeddedFiles, err + } + + htmlBody += strings.TrimSuffix(string(ppContent[:]), "\n") } else if isAttachment(part) { at, err := decodeAttachment(part) if err != nil { diff --git a/parsemail_test.go b/parsemail_test.go index 3f3a825..109e734 100644 --- a/parsemail_test.go +++ b/parsemail_test.go @@ -296,6 +296,26 @@ So, "Hello".`, textBody: `plain text part`, }, 10: { + contentType: `multipart/mixed; boundary="0000000000007e2bb40587e36196"`, + mailData: textHTMLInMultipart, + subject: "Re: kern/54143 (virtualbox)", + from: []mail.Address{ + { + Name: "Rares", + Address: "rares@example.com", + }, + }, + to: []mail.Address{ + { + Name: "", + Address: "bugs@example.com", + }, + }, + date: parseDate("Fri, 02 May 2019 11:25:35 +0300"), + textBody: ``, + htmlBody: "