SPEmailEventReceiver Class
Provides a method for trapping the event when a list receives an e-mail message.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
An incoming e-mail event receiver must derive from this class and override the EmailReceived method.
The following code example shows how to use the SPEmailEventReceiver class in an event handler that responds to e-mail messages received in a list by adding an item to the list.
This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint and Microsoft.SharePoint.Utilities namespaces.
namespace Example_Namespace { public class Email_Handler: SPEmailEventReceiver { public override void EmailReceived( SPList oList, SPEmailMessage oMessage, string strReceiverData) { SPListItem oListItem = oList.Items.Add(); oListItem["Title"] = oMessage.Headers["Subject"]; oListItem["Body"] = oMessage.HtmlBody; oListItem.Update(); } } }
Note |
|---|
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects. |
I have used some 3rd Party Tools for Outlook and SharePoint that saved me from some of this:
- Cloud2050.com
- Scinaptic's OnePlaceMail
- Colligo
- Macroview
Hope this helps
@AdamCogan
www.adamcogan.com
- 2/6/2012
- Adam Cogan
- 2/29/2012
- Jasonzh2010
The email event feature can only be done in the web scope. Otherwise there will be no possibility of debugging event code.
- 9/10/2011
- Mahdi Kheirmandi
http://solutiondumps.blogspot.com/2011/01/how-to-customize-sharepoint-e-mail.html
- 1/12/2011
- Dinko Fabricni
Note