Unable to use SPEmailEventReceiver
-
06-12-2019 - |
문제
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
해결책 2
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.
다른 팁
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