Body Conversion Sample Application
Topic Last Modified: 2007-06-18
This sample shows you how to filter scripts out of e-mail messages. This sample application does this by determining the format of the incoming message and deciding if filtering must occur. If filtering is needed, the content is converted to HTML, filtered, and then converted back to the source format.
Structure of the Sample
The Body Conversion sample agent consists of a simple Microsoft Visual Studio .NET 2005 C# project. By default, the files are installed in the directory in which the Microsoft Exchange Server 2007 Software Development Kit (SDK) is installed, in the \Samples\BodyConversion folder.
The following are the primary files for the sample:
- Install.ps1 An Exchange Management Shell script to install the compiled sample.
- Uinstall.ps1 An Exchange Management Shell script to uninstall the compiled sample.
- BodyConversion.csproj The Visual Studio C# project file.
- BodyConversion.cs The C# source code for the sample.
Building the Sample
To build the Body Conversion sample agent, you must first install Visual Studio .NET 2005 and the Microsoft .NET Framework version 2.0 on the computer that is running Microsoft Exchange Server 2007 that has the Edge Transport server role installed.
After you install the required software, open the C# project by using Visual Studio .NET. If it is necessary, update the references to the Microsoft.Exchange.Data.* namespaces. Build the project and fix any errors you encounter.
Installing the Sample
To install the Body Conversion sample agent
Edit the install.ps1 script to make sure that the $EXDIR variable is correctly initialized for your system. The value of the $EXDIR variable should be the path of the Exchange Server 2007 installation directory.
Open the Exchange Management Shell and run the install.ps1 script.
Restart the Exchange 2007 computer.
Uninstalling the Sample
To uninstall the Body Conversion sample agent
Edit the uninstall.ps1 script to make sure that the $EXDIR variable is correctly initialized for your system. The value of the $EXDIR variable should be the path of the Exchange Server 2007 installation directory.
Open the Exchange Management Shell and run the uninstall.ps1 script.