CRM 2013 – Convert Email HTML to Plain Text

I have had this request from a few customers over the years and it’s converting and using the description of an email is trickier than you initially think it will be.  This is a question which often appears on the CRM forum quite regularly as well.

The reason for this is although the email looks like plain text when you see it in CRM, when you get the value of the Email entity description (main body of the email) you will also get all the HTML tags.

The scenario I had when I was doing this was the customer wanted to convert an email into a case and get the values from description.

So to do this I had to strip out the HTML tags and a few other things, which I did using a plugin

if you have to do this here a couple

This blog post is excellent

C# code

A sample plugin


Recently I saw Steve Green had created a CRM Video going through the process and  I thought I would promote the video on the blog because he also has a link to the code here



I would also recommend anyone who wants to learn CRM development to go through Steve’s other CRM videos, many of them are in CRM 2011 but the code would still work in CRM 2013.

4 thoughts on “CRM 2013 – Convert Email HTML to Plain Text

  1. Raj Y Raman (@RajYRaman) September 29, 2014 / 11:43 pm

    Can’t we just add an IFrame to the form and inject the email’s html contents to it using JS? Eg.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s