SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 0 down vote accepted

Are you running solution in sandbox type solution?

If so, try full trust type.

share|improve this answer

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

share|improve this answer
yes. i have add microsoft.sharepoint and microsoft.sharepoint.utilities namespaces. but still error. there is SPEmailEventReceiver in sharepoint 2013? in my solution sp2013. i'm can't found SPEmailEventReceiver in sharepoint on object browser. in my solution sp2010. i found SPEmailEventReceiver on object browser. – user23495 Feb 7 '14 at 0:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.