How to convert RTF to HTML email with embedded images and send it via SmtpClient in .NET C#
In this article you will find how to create a simple .NET/C# application which converts RTF document to HTML email with embedded images and sends it using MS Outlook programmatically.
Let’s make a C# code satisfying of these conditions:
- Acceptable for any .NET application: ASP.NET, Windows Forms, WPF, Console, Web Service, SilverLight etc.
- Works at 32-bit and 64-bit Windows machines.
- Compatible with .NET 2.0, 3.5 , 4.0, 4.5 frameworks and even higher if such will appear.
To make converting of RTF to HTML email with images at server-side we’ll use RTF-to-HTML DLL .Net library. It’s .Net component which will provides API to convert RTF to HTML with all images which we’ll get in a list after converting. We need these images extracted from RTF to further adding them into email as attachments.

To get the ball rolling, download the RTF-to-HTML DLL .Net component from here:
To check this out first hand, unpack the archive and create a new C# Console Application named SmtpRtfToHtml. Next add reference to the “SautinSoft.RtfToHtml.dll” as shown on picture below:

How to add a reference to SautinSoft.RtfToHtml.dll
This is C# code of our application: