You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Both HtmlBody and TextBody return null for some Apple Mail messages. However the bodies can be retrieved by enumerating BodyParts manually like this:
body = ((TextPart)msg.BodyParts.FirstOrDefault(b => b is TextPart && b.ContentType.MimeType == "text/html"))?.Text;
MimeKit Version: 4.2.0
To Reproduce
I've attached an .eml file and cleared out all the sensitive info from it.
Expected behavior
HtmlBody should be set to first BodyPart maybe?
Additional context
I totally understand that the message hierarchy is kinda, uhm, malformed. However maybe you would like to add a workaround b/c this is from iOS 16 Mail app which is becoming popular. test321.zip
The text was updated successfully, but these errors were encountered:
alex-jitbit
changed the title
Empty HtmlBody for some Apple Mail messages
Empty HtmlBody for some Apple Mail messages (sent from iOS)
Oct 16, 2023
I've taken a look at the message and it appears that the mime structure is as follows:
multipart/alternative
multipart/mixed
text/html
text/html
text/html
It's a pretty bizarre structure that I'm not entirely sure how to interpret.
Expected behavior
HtmlBody should be set to first BodyPart maybe?
Maybe? Technically speaking, the entire multipart/mixed is the "body". Each child of a multipart/alternative is supposed to be an option to use as the message body, each being an "alternative" to its siblings. In this case, the multipart/mixed is the only child of the multipart/alternative.
This cleans up the old logic internal to MimeMessage for getting the
message body in a specified format to the Multipart subclasses.
Should also fix issue #963
Describe the bug
Both
HtmlBody
andTextBody
return null for some Apple Mail messages. However the bodies can be retrieved by enumeratingBodyParts
manually like this:To Reproduce
I've attached an .eml file and cleared out all the sensitive info from it.
Expected behavior
HtmlBody should be set to first BodyPart maybe?
Additional context
I totally understand that the message hierarchy is kinda, uhm, malformed. However maybe you would like to add a workaround b/c this is from iOS 16 Mail app which is becoming popular.
test321.zip
The text was updated successfully, but these errors were encountered: