1

We use the LumiSoft.NET MIME library to create EML files. These EML files are constructed by database values. The body of the email can be plain text, RTF, or HTML. We know when the body is HTML so, when that occurs, our EML file's content-type is set with this line:

Content-Type: text/html; charset="utf-8"

When the body is plain text or RTF (because we don't know which it is), we set the content-type to RTF like so

Content-Type: text/rtf; charset="utf-8".

The HTML EML files show up just fine across different products... but the RTF EML files seem to be interpreted differently by different products. This worked for years and our resulting EML files were QA'd against Outlook Express and they appeared normally. But recently we had some customers report issues with these emails showing up with the message bodies as attachments. In Outlook 2007 SP2 and Outlook 2010, the email bodies do indeed show up as TXT files that are attached to the email... and the bodies inside the email itself are empty. Furthermore, we use a product called dtSearch and when it converts these EML files to HTML, it does a similar translation where the body of the EML file is shown in the content of an attachment named Attachment0.DAT. Futhermore, we also process these EML files through Outlook Redemption and, just like Outlook 2010, the message bodies are in a TXT file attachment. So weird behavior across the board... here's some screenshot of it in action.

Outlook Express:

enter image description here

Outlook 2010:

enter image description here

Here's the actual EML file.

Are we doing something wrong here by using RTF for the content type? It seems to have worked in the past and works with Outlook Express. It's been recommended to switch to the MSG format using Redemption instead of EML format to alleviate this but I believe that puts a prerequisite requirement on the user machine of either Outlook or the MAPI library.... but if the EML format isn't parsed the same by different products, then maybe the MSG format is the way to go.

1 Answer 1

2

The content of the email does not look like a valid rtf (No magic number "{\rtf").

It's plain text with quoted printable transfer encoding.

You should use content-type: text/plain.

3
  • I understand this particular EML file has no RTF 'tags' in the body. I also understand that using text/plain will work in Outlook 2010... but the way the logic in our application works is that we set them all the RTF because they may or may not contain it. As I've shown above, with Outlook Express, this wasn't a problem; the EML bodies were displayed correctly. This leads me back to my original question, why? And furthermore, if we make this change to our application logic, will this happen again in the next Outlook (or other email application)? Hopefully the answer to "why" will address this.
    – Biggert
    Jul 28, 2011 at 18:13
  • 2
    @Biggert Your application logic is incorrect. You should not be setting rtf content type when the message you are transmitting is in plain text. Jul 28, 2011 at 19:11
  • You need to fix your application logic, even if you have to do something like test if the plain text contains {\rtf and if it does then set to text/rtf; otherwise set it to text/plain. Your default setting for you don't know should be plain text not rtf.
    – Seph
    Oct 20, 2011 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.