reading emails from drop folder to board discussion
- 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
- 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- Marked As Answer byCharlie WuModeratorMonday, November 09, 2009 1:14 AM
All Replies
- 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- Marked As Answer byCharlie WuModeratorMonday, November 09, 2009 1:14 AM
- 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 - 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- Unmarked As Answer byFadwa Mohammed Monday, November 09, 2009 5:38 AM
- Marked As Answer byCharlie WuModeratorMonday, November 09, 2009 1:14 AM
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 ?
- 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- Unmarked As Answer byFadwa Mohammed Monday, November 09, 2009 5:37 AM
- Marked As Answer byCharlie WuModeratorMonday, November 09, 2009 1:14 AM
- Marked As Answer byFadwa Mohammed Monday, November 09, 2009 5:38 AM
- Unmarked As Answer byFadwa Mohammed Monday, November 09, 2009 5:38 AM
- Hi, Peter
Now it's work fine, I thank u so much . 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
- 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 SPEmailEventReceiverPublic 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

