Hi All,
 
Has anyone ever had any luck overriding the SPEmailReceiver class for a
document library?  I have coded a simple one, but am having problems
getting it to fire.
 
----
namespace Eversheds.SharePoint.Portal.EventHandlers.KnowledgeSubmissions
{
    public class EmailHandler : SPEmailEventReceiver
    {
        public override void EmailReceived(SPList list,
Microsoft.SharePoint.Utilities.SPEmailMessage emailMessage, string
receiverData)
        {
            base.EmailReceived(list, emailMessage, receiverData);
 
            SPListItem listItem = list.Items.Add();
            listItem["Title"] = emailMessage.Headers["Subject"];
            listItem["Body"] = emailMessage.HtmlBody;
 
            foreach (SPEmailHeader hdr in emailMessage.Headers)
            {
                string name = hdr.Name;
                string value = hdr.Value;
            }
 
        }
    }
}
----
 
I have tried binding it to my list with a <Receivers> element in my
feature's elements.xml:
 
----
  <!-- Email Event Receiver for the Knowledge Submissions Library -->
  <Receivers ListTemplateOwner="EE2458B8-4594-4bef-A9F9-29D9F3D3A632"
ListTemplateId="101">
    <Receiver>
      <Name>EmailHandler</Name>
      <Type>EmailReceived</Type>
      <SequenceNumber>10000</SequenceNumber>
      <Assembly>Eversheds.SharePoint.Portal.EventHandlers,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=9f525b76b9e4fb66</Assembly>
 
<Class>Eversheds.SharePoint.Portal.EventHandlers.KnowledgeSubmissions.Em
ailHandler</Class>
    </Receiver>
  </Receivers>
----
 
and also in code within my feature event receiver with a SPList.call:
 
----
//Set the item rec'd event handler against Knowledge Items library
string assm = "Eversheds.SharePoint.Portal.EventHandlers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f525b76b9e4fb66";
 
string nsp =
"Eversheds.SharePoint.Portal.EventHandlers.KnowledgeSubmissions.ItemHand
ler";
web.Lists["Knowledge
Items"].EventReceivers.Add(SPEventReceiverType.EmailReceived, assm,
nsp);
 
//Set the email rec'd event handler against Knowledge Items library
nsp =
"Eversheds.SharePoint.Portal.EventHandlers.KnowledgeSubmissions.EmailHan
dler";
web.Lists["Knowledge
Items"].EventReceivers.Add(SPEventReceiverType.EmailReceived, assm,
nsp);
----
 
 
but everytime I expect it to fire, I get the follow app event log error:
 
----
Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: General 
Event ID: 6644
Date:  25/07/2008
Time:  10:15:02
User:  N/A
Computer: EVERSHEDS
Description:
Event manager error: Could not load type
'Eversheds.SharePoint.Portal.EventHandlers.KnowledgeSubmissions.EmailHan
dler' from assembly 'Eversheds.SharePoint.Portal.EventHandlers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f525b76b9e4fb66'.
 
For more information, see Help and Support Center at 
http://go.microsoft.com/fwlink/events.asp.
----
 
 
I am fairly certain my type information is correct (have checked it via
Reflector), but just to make certain, I changed the code in my
"ItemHandler" event handler (which has been working fine) so that its
namespace had the email receiver in it - and got the same type error!
 
This is driving me crazy - I expected the ItemReceiver to fire when
emails were delivered to the library, but this doesn't happen (why
not?!?), so I thought I would be able to use this event handler to
handle the stuff I want to do to email - but no luck!
 
If anyone can see where I am going wrong, or could provide some code
snippets for a handler that actually works (binding and handler please)
I would really appreciate it.
 
Cheers,
 
Nigel Witherdin
Senior Support Analyst
Eversheds
 
Direct Dial: +44 (0) 84 549 754 17
Mobile: +44 (0) 7738 553256
 
www.eversheds.com <http://www.eversheds.com/> 
 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Aaron Saikovski
Sent: 25 July 2008 00:23
To: [email protected]
Subject: RE: [OzMOSS] Infrastructure update for WSS and MOSS



And please pay attention to the installation instructions J

Kind Regards,

Aaron Saikovski

Aaron Saikovski | Senior Consultant | Microsoft Services | Microsoft Pty
Australia | t: +61 2 8817 9280 | m: +61 410 480 971 | e: 
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  |
a: 1 Epping Road, North Ryde,  NSW 2113

Disclaimer:     This email may contain confidential information. If you
are not named on the addressee list, please take no action in relation
to this email, do not open any attachment, and please contact the sender
(details above) immediately. Information in this email is provided in
good faith.  If you are a customer of Microsoft, please refer to the
terms and conditions which cover the provision of support and consulting
services to you/your organization.  If you are not corresponding in the
course of, or in connection with a Microsoft contract or programme with
its own terms and conditions, please note that no liability is accepted
by Microsoft for the contents of this mail. 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Ed Richard
Sent: Thursday, 24 July 2008 10:07 PM
To: [email protected]
Subject: [OzMOSS] Infrastructure update for WSS and MOSS

Just making sure everyone is aware of this important update. I haven't
seen it being mentioned in this list.

http://blogs.msdn.com/sharepoint/archive/2008/07/15/announcing-availabil
ity-of-infrastructure-updates.aspx

Ed Richard
MOSSIG Board Member
M:  04 06385559  P:  03 97623155
E: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
W: www.mossig.net <http://www.mossig.net>  B: EdOnOffice
<http://edonoffice.blogspot.com/> 

 

Microsoft Office System Special Interest Group (MOSSIG) - Melbourne
Please consider the environment before printing this email.

-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com 

-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com 



****** This email is sent for and on behalf of Eversheds LLP ******

This email is sent for and on behalf of Eversheds LLP which is a limited 
liability partnership, registered in England and Wales, registered number 
OC304065. Registered office One Wood Street, London. EC2V 7WS.  Registered VAT 
number GB820704559. A list of the members' names and their professional 
qualifications is available for inspection at the above office. Regulated by 
the Solicitors Regulation Authority (see www.sra.org.uk). 

Confidentiality:  This email and its attachments are intended for the above 
named only and may be confidential.  If they have come to you in error you must 
take no action based on them, nor must you copy or show them to anyone; please 
reply to this email and highlight the error.

************* [ www.eversheds.com ] *************



------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.

Powered by mailenable.com

<<image001.jpg>>

Reply via email to