Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm attempting to create a SPEmailEventReciever on an Email enabled library...The problem is that intellisense is not showing that class for me, so I am unable to inherit from it.

MSDN shows it in the Microsoft.SharePoint workflow namespace, so it should show up with all of the other classes (such as SPItemEventReciever, etc).

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spemaileventreceiver.aspx

share|improve this question
    
Works ok for me. Are you creating your class from scratch or using the Visual Studio tools to Add new item > Event receiver > List Email Events etc –  Paul Lucas Nov 11 '11 at 0:45
    
I just used the designer and selected List Email events...It auto-generated the class inheriting from SPEmailEventReceiver, except intellisense doesn't like the class name. It prevents me from building. –  Tim Gabrhel Nov 11 '11 at 14:06
add comment

2 Answers

For intellisense, There might be some problem with your VS templates for SharePoint. Anyway, problem with intellisense will not stop you to inherit the class in code. Create a class like below :

    public class EventReceiver1 : SPEmailEventReceiver
    {
       /// <summary>
       /// The list received an e-mail message.
       /// </summary>
       public override void EmailReceived(SPList list, SPEmailMessage emailMessage, String receiverData)
       {
           base.EmailReceived(list, emailMessage, receiverData);
       }


    }

Ensure that you have reference for Microsoft.SharePoint.dll

share|improve this answer
add comment
up vote 0 down vote accepted

I deleted the project and re-added it. It worked fine this time.

I'm wondering if it was because I accidentally selected 'Sandboxed Solution' when initially creating the project.

share|improve this answer
add comment

Your Answer

 
discard

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.