C# scripts are not supported in the Web app See the item compatibility table
See also:
Using scripts to filter emails
Scripting in EmailParser. An Overview
This example shows how filtering with a C# script works in the Email Parser Windows App. If the email contains two .jpg attachments the filter is passed, otherwise the email is rejected. The overview of the left panel is as follows:
If we open the filter settings the checkbox to enable script filtering is activated and the script is shown below:
The full script is:
using System; using System.Net.Mail; using EmailParserBackendApi.ScriptingInterface; public class MyFilter : ScriptBasedEmailFilter { public override bool FilterEmail(MailMessage msg) { // Check if the email contains two attachments if (msg.Attachments.Count != 2) { // Reject the email and finish return (false); } // Check if the two attachments are jpg files if (msg.Attachments[0].Name.Contains(".jpg") && msg.Attachments[1].Name.Contains(".jpg")) { // Accept the email and finish return (true); } else { // Reject the email and finish return (false); } } }