nodemailer / mailparser

Decode mime formatted e-mails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not parsing multipart email properly

yashgandhi32 opened this issue · comments

commented

I am trying to parse it using mailparser but receiving HTML false. How can it be resolved?

X-sender: <sender@sendersdomain.com>
X-receiver: <somerecipient@recipientdomain.com>
From: "Senders Name" <sender@sendersdomain.com>
To: "Recipient Name" <somerecipient@recipientdomain.com>
Message-ID: <5bec11c119194c14999e592feb46e3cf@sendersdomain.com>
Date: Sat, 24 Sep 2005 15:06:49 -0400
Subject: Sample Multi-Part
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D"

------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Sample Text Content
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html>
<head>
</head>
<body>
<div style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sample HTML =
Content</div>
</body>
</html>

------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D--

I don't know if this is a copy paste error or not but your boundary=".. line is not properly nested. Add some spaces before the value and it should fix parsing.