12

Very simple set-up:

Visual Studio --> Add New Item --> List Definition. Type: Document Library. Besides that - no changes. Deploy.

Result:
enter image description here

As you can see: No "configure incoming e-mail settings" link.

When I create a document library the regular way (e.g. Site Actions --> New Document Library) I get the wanted result:
enter image description here

How to I get the "Incoming e-mail settings" link on a document library deployed via Visual Studio?


EDIT (thanks to Falak):
The solution is to add (even if only a dummy) SPEmailEventreceiver to the list. So if you do this:

public class MyMailEventReceiver : SPEmailEventReceiver
{
    public override void EmailReceived(SPList list, SPEmailMessage emailMessage, string receiverData)
    {
        base.EmailReceived(list, emailMessage, receiverData);
    }
}

and the elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Receivers ListTemplateId="xyz"> <!-- add the correct template id here -->
      <Receiver>
        <Name>MyMailEventReceiver</Name>
        <Type>EmailReceived</Type>
        <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
        <Class>myAssembly.MyMailEventReceiver</Class>
        <SequenceNumber>10000</SequenceNumber>
      </Receiver>
  </Receivers>
</Elements>

Voilá, I have the incoming e-mail settings link in the document library settings.

10

SharePoint only shows Incoming Email settings link for OOTB lists of type Announcements, Event, Document Library, Picture Library, XML Form, Discussion Board, Posts.

So, if you create a custom list, you need to create a custom email event handler and attach to your list and then Incoming Email settings link will be available.

More info: http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f8d57aba-2a0e-41a1-a280-2e022f5604e3

  • Great documentation on the MS side... I added the solution above for future reference. – Dennis G May 21 '12 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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