SPEmailEventReceiver in sharepoint 2013
Question
I'm stuck in use of SPEmailEventReceiver in sharepoint 2013.
this my code:
public class EREmail : SPEmailEventReceiver // this error because namespace can't found
{
public override void EmailReceived(SPList list, SPEmailMessage emailMessage, String receiverData) // this error because namespace SPEmailMessage can't found
{
base.EmailReceived(list, emailMessage, receiverData);
}
}
the above code produces error in both VS 2013 and VS 2012.
Any suggestion? help me
Solution
Are you running solution in sandbox type solution?
If so, try full trust type.
OTHER TIPS
Have you added both the using directives mentioned in the MSDN documentation?
This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint and Microsoft.SharePoint.Utilities namespaces.
It seems to not be enough to use Microsoft.SharePoint, you also need Microsoft.SharePoint.Utilities
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange