Une simple liste (pour autant que je sais, mais je peux me tromper) n'a pas la capacité de recevoir des e-mails. Vous pouvez créer une liste personnalisée qui le fait.
Vous pouvez créer une bibliothèque de documents qui a cette capacité par défaut.
Comment ces propriétés sont définies, vous pouvez voir lorsque vous examinez le code (en utilisant réflecteur, http://www.red-gate.com/products/reflector/ de Lutz Roeder) de /_layouts/EmailSettings.aspx
qui peut être trouvée dans « Microsoft.SharePoint.ApplicationPages.dll » figurant sur votre serveur dans le chemin quelque chose comme \\server\c$\Inetpub\wwwroot\wss\VirtualDirectories\80\_app_bin
. Vous devrez donc définir plusieurs propriétés du "root folder" de la bibliothèque de documents.
Le code est le suivant:
Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal args As EventArgs)
If Me.EnabledTrue.Checked Then
If ((Me.TxtAlias.Text Is Nothing) OrElse (Me.TxtAlias.Text.Length = 0)) Then
Throw New SPException(SPResource.GetString("MissingEmailAlias", New Object(0 - 1) {}))
End If
'This will be the receiving e-mail address
Me.m_List.EmailAlias = Me.TxtAlias.Text
'do we need to check users permissions on items
Me.m_RootFolder.Properties.Item("vti_emailusesecurity") = IIf(Me.UseSecurityTrue.Checked, 1, 0)
If Me.ShowSaveAttachments Then
'options how to save attachments, root folder, grouped, whatever
Me.m_RootFolder.Properties.Item("vti_emailsaveattachments") = IIf(Me.SaveAttachmentsTrue.Checked, 1, 0)
End If
If Me.ShowSaveOriginalAndMeetings Then
Me.m_RootFolder.Properties.Item("vti_emailsavemeetings") = IIf(Me.MeetingsTrue.Checked, 1, 0)
Me.m_RootFolder.Properties.Item("vti_emailsaveoriginal") = IIf(Me.SaveOriginalTrue.Checked, 1, 0)
End If
If Me.ShowAttachmentFolders Then
Me.m_RootFolder.Properties.Item("vti_emailoverwrite") = IIf(Me.OverwriteTrue.Checked, 1, 0)
If Me.AttachmentFoldersSender.Checked Then
Me.m_RootFolder.Properties.Item("vti_emailattachmentfolders") = "sender"
ElseIf Me.AttachmentFoldersSubject.Checked Then
Me.m_RootFolder.Properties.Item("vti_emailattachmentfolders") = "subject"
Else
Me.m_RootFolder.Properties.Item("vti_emailattachmentfolders") = "root"
End If
End If
If Me.ShowAutoApprove Then
'I think this is something when content approval is enabled.
Me.m_RootFolder.Properties.Item("vti_emailautoapprove") = IIf(Me.AutoApproveTrue.Checked, 1, 0)
End If
ElseIf Me.EnabledFalse.Checked Then
Me.m_List.EmailAlias = Nothing
End If
Me.m_RootFolder.Update
Me.m_List.ResetContentTypes
Me.m_List.Update
SPUtility.Redirect((IIf((Me.m_List.BaseType = SPBaseType.Survey), "survedit", "listedit") & ".aspx?List=" & Me.m_List.ID.ToString), SPRedirectFlags.RelativeToLocalizedLayoutsPage, Me.Context)
End Sub
EDIT: les commentaires ajoutés à mon code