email parsing automation

Email Parser

Extract data from emails and automate your workflow

The forum is now read only. Please, go to the the main Email Parser website if you need help.
Post here if you experience problems or get unexpected errors.
Hello,

When testing or executing Email&Parser, there is an error when compiling "script-based" actions. We get the following message:
Error.Unable to compile the script:
Line 11: 'FiltrerEmails.Run(System.Collections.Specialized.NameValueCollection)': no suitable method found to override
Line 9: 'FiltrerEmails' does not implement inherited abstract member 'EmailAndParser.ScriptingInterface.ScriptBasedAction.Run(System.Net.Mail.MailMessage, System.Collections.Specialized.NameValueCollection)'
The code of the script based action is the following (Default one when creating a script based action):

[syntax=csharp]using System;
using System.Text;
using System.IO;
using System.Net;
using System.Windows.Forms;
using System.Collections.Specialized;
using EmailAndParser.ScriptingInterface;

public class FiltrerEmails : ScriptBasedAction {

public override bool Run(NameValueCollection fields)
{
return(true);
}
}[/syntax]

Do you have an idea where this may come from?
We are using Windows Server 2008 R2, and have installed .NET Framework. (We have tried with different versions of .NET Framework and always have the same message.) (3.0, 3.5, 4.0 ...)

It works on another machine which is a Windows 7.

Thank you for your help.
Romain.
Hello Romain, thanks for posting here.

The parameters of the Run() method have been changed. Note that you can add any code you want to the script, more methods, properties, whatever but the name of the class and the Run() method header must be kept.

I also see that you have mixed a script-based action and a script-based filter. Take a look at the following templates:


Script-based action template:

[syntax=csharp]
using System;
using System.Text;
using System.IO;
using System.Net.Mail;
using System.Collections.Specialized;
using EmailAndParser.ScriptingInterface;

public class MyAction : ScriptBasedAction
{
public override bool Run(MailMessage email, NameValueCollection fields)
{
// Your code goes here

// this action finishes successfully
return(true);
}
}
[/syntax]

Script-based email filter template:

[syntax=csharp]
using System;
using System.Net.Mail;
using EmailAndParser.ScriptingInterface;

public class MyFilter : ScriptBasedEmailFilter
{
public override bool FilterEmail(MailMessage msg)
{

// Your code goes here

// this email does not pass the filter
return(false);
}
}
[/syntax]

You may find useful the Email&Parser scripting SDK (very handy for testing the scripts):

http://www.automatedemailparser.com/d/e ... ing-sdk-52