Ask a questionAsk a question
 

Answerreading emails from drop folder to board discussion

  • Thursday, November 05, 2009 1:55 PMFadwa Mohammed Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi, everybody,


    can i write code to move the emails from the drop folder to the board discussion  sharepoint ? because not all the incoming emails  drop to the discussion sharepoint

Answers

  • Friday, November 06, 2009 9:05 AMPeter Holpar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    If you have incoming mails enabled, and not all of the mails are processed /dropped into the target discussion list, then you should try to solve that on the infrastructure level first.

    Then, if it does not work, you may disable the incoming mail feaure for the list, and create an SMPT event sink for the incoming mails and create the discussion list items from that code.

    Finally, as a third option only in my opinion, you can create a custom service (or timer job) that picks up items from the drop folder and create discussion list items based on them.

    Peter

All Replies

  • Friday, November 06, 2009 9:05 AMPeter Holpar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    If you have incoming mails enabled, and not all of the mails are processed /dropped into the target discussion list, then you should try to solve that on the infrastructure level first.

    Then, if it does not work, you may disable the incoming mail feaure for the list, and create an SMPT event sink for the incoming mails and create the discussion list items from that code.

    Finally, as a third option only in my opinion, you can create a custom service (or timer job) that picks up items from the drop folder and create discussion list items based on them.

    Peter
  • Friday, November 06, 2009 2:35 PMFadwa Mohammed Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi, Peter

    I'm sorry late to reply, u told me I can solve that on the infrastructure level first  How I can do that ?

    Fadwa
  • Friday, November 06, 2009 2:46 PMPeter Holpar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Fadwa,

    No problem. :-)

    I wrote you should try to solve it on the infrastrucure level, that is not the same to you can solve it. About the how, it might be better to post a question on the Setup, Upgrade, Administration and Operation forum (http://social.msdn.microsoft.com/Forums/en-US/sharepointadmin/threads), and then fall back here for option 2 and 3 if the guys there are not able to help you to get the solution.

    Am I correct if I understand your original mail as you incoming mail-enabled your discussion list, but only a part of the mails sent to the list are received correctly?

    Peter
  • Saturday, November 07, 2009 8:03 AMFadwa Mohammed Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    ok, I will creating for that but I create class library of the SPEmailEventReceiver  , but how i can deply it on the board discussion , can u help me ?

  • Saturday, November 07, 2009 8:17 AMPeter Holpar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    You can register that kind of event sink as you do in case of other event receiver types, either from feature, from code or using tools  (see samples here: http://sharepointadminwiki.com/display/public/Event+Receivers). For tools I usually suggest using Patrick Tisseghem's Event Handler Explorer (http://www.u2u.info/SharePoint/U2U%20Community%20Tools/EventHandlerExplorer.zip).

    SPEmailEventReceiver can be another alternative, but when I wrote SMTP event sink I really ment a very different layer of the architecture. It means capturing and procressing the mail on the SMTP service level, before the mail is handled to the WSS mail processing pipe.

    Unfortunately, I found only samples for Exchange only, but one can create similar type of handlers without Exchange, using only the standard SMTP services:
    How to write an OnArrival-type SMTP event sink in managed code by using Visual Studio .NET 2003
    http://support.microsoft.com/kb/894286
    How to register a transport event sink for the SMTP Service in Exchange 2000 Server
    http://support.microsoft.com/kb/313404

    A few years ago I wrote an article about that for ASPToday (Wrox) that was published later as a PDF by Apress:
    Understanding SMTP Event Sinks: Developing a Simple Mailing List System with VB and CDO
    http://www.amazon.com/Understanding-SMTP-Event-Sinks-Developing/dp/B0007MHF3G/ref=sr_1_1?ie=UTF8&s=books&qid=1257581737&sr=1-1

    Peter
  • Sunday, November 08, 2009 11:29 AMFadwa Mohammed Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi, Peter

    Now it's work fine, I thank u so much .
  • Sunday, November 08, 2009 3:37 PMPeter Holpar Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Fadwa,

    I'm glad to hear that it is OK now. If one (or more) of the replies is helpful or answers your question, please mark it as such. If you need more help on the topic, please, let us know how we can help you!

    Thanks!

    Peter

  • Tuesday, November 10, 2009 7:38 AMFadwa Mohammed Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi, Peter

    I'm sorry troubling u, but i have problem the created by it display system account and the subject it display none title although I used this code :

    Imports

     

    Microsoft.SharePoint
    Imports Microsoft.SharePoint.Utilities
    Namespace board_dis_receive_email
    Public Class board_dis_receive_email
          Inherits SPEmailEventReceiver

     

    Public Overrides Sub EmailReceived(ByVal list As Microsoft.SharePoint.SPList, ByVal emailMessage As Microsoft.SharePoint.Utilities.SPEmailMessage, ByVal receiverData As String)
    MyBase.EmailReceived(list, emailMessage, receiverData)
    Dim item As SPListItem = list.Items.Add
    item(
    "subject") = emailMessage.Headers("Title")
    item(
    "Body") = emailMessage.HtmlBody
    item.Update()
    End Sub
    End Class
    End
    Namespace