Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML body is treated as an attachment when converted from TNEF #435

Closed
ymassad opened this issue Sep 27, 2018 · 1 comment
Closed

HTML body is treated as an attachment when converted from TNEF #435

ymassad opened this issue Sep 27, 2018 · 1 comment
Labels
compatibility Compatibility with existing software enhancement New feature or request

Comments

@ymassad
Copy link

ymassad commented Sep 27, 2018

I am using TnefPart.ConvertToMessage to convert a TNEF message to Mime.

The html body content type looks like this (this is the result of conversion):

Content-Type: text/html; name=body.html; charset=windows-1252

When the message is opened in outlook, the message contains no body, but there is a body.html attachment that contains the body.

If I remove 'name=body.html' from the content-type manually, the html body shows in outlook correctly.

Should outlook know to display the html body correctly even if it has 'name=body.html'? Or should MimeKit not put 'name=body.html' into the content-type?

jstedfast added a commit that referenced this issue Sep 27, 2018
@jstedfast
Copy link
Owner

Outlook should know better.

The name parameter has no bearing on whether something is supposed to be treated as an attachment or not according to the email specifications. The only thing that does have a bearing on that is the Content-Disposition header and whether it has a value of attachment or not (the default is to assume "not an attachment").

What you can do is to locate the HTML body and modify the MimeEntity.ContentType property to remove the name parameter.

That said, I'll change the code to not set the name parameter in a future release since it's not really needed.

@jstedfast jstedfast added enhancement New feature or request compatibility Compatibility with existing software labels Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with existing software enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants