.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Parsing the email body content in a SPEmailEventReceiver class

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :SharePoint
Hi All, 1. I have an email enabled Sharepoint list which have certain fields like Fname,Lname,Address,Phonenumber   2. Someone will send an email to this list   the email body like this   Fname: Mohammed Lname:Hanif Adress:CA Phonenumber:001234   Now i have to read this body and create a new item in this List where the list fields value will be like this Fname: Mohammed Lname:Hanif Address:CA Phonenumber:001234 Created BY: Email Sender   I can parse the subject and sender to list columns but my problem is to read the content of the Email Body identify the Field value and copy it to corresponding List Fields.   Any help is much appreciated. Regards, Hanif Hanif

View Complete Post

More Related Resource Links

Email entry editor with content from the entry in the email subject and body


Hi All,


First to apologies if this question should go into development section, i am putting it here as i am not sure if this can be achieved with SharePoint out of the box without custom applications.


SharePoint server 2007 and Live communications server 2007 are in question


We have a List with numerous entries, the list itself is custom but simple, only text and numbers without any formulas etc.

At the end of the list we have a column with name of “Modified By” user with Presence, we use Presence to email the person who last modified the entry.

Now my question is, is there Any way in SharePoint Server out of the box that I could get Entry Title in the subject of the email when we email the editor, and maybe another entry property in the body of the email?

I can imagine that this probably isnt possible by using presence for the editor but presence is not a requirement there, it is only used in the view for ablitity to email the editor

thank you


Best regex for email body on contact form?

I'm not sure the best way to do a regex for the body section of an email contact form.  I want to use the regex to prevent more than 150 characters from being entered.  I assume this is sufficient, I may need more.  I also want it to help guard against sql injection attacks. The more I think about it the more characters I can think of that should be allowed.  I want to allow punctuation since it's for an email and people should be using full sentences.  These are some other things that make sense to allow: " , ', : , ; , $ , . , ! , ? , - , _ , @ , & , ( , ). They cover situations when someone may put an email address or phone number in the body section for the email.  I also want to allow letters and numbers.    I'm not sure if it's best to allow the characters I mentioned or not allow characters that pose a potential threat.  I think allowing the ones I want is the best way, but I'm not sure.  Can someone please give an example and/or suggestions?  Are there other characters that should be allowed?  I don't have much yet: "^(?i)[a-z0-9\s]{1,150}$"

SQL Server Tables and Exchange Web Services sample does not include email body

I've sucessfuly implemented the above, very useful example. However, I cannot work out how to include the Body of the email with the reast of the data. Can anyone shed some light for me? Thanks Robert

Immediate alert email body is truncated intermittently in MOSS 2007

Hi All, I  am facing one issue with Alert. We have one Posts list in one of the Blog where Alert Me generates immediate alert for the users who have subscribed to the Blogs. Whenever any new Post added, edited or deleted they used to get alerts. But in the alert email, the body of the alert which normally contains the Post decsription gets truncated intermittently. Sometimes it is truncated with less than 2048 characters in the Body filed and some times with more than 4098 characters. I found in some articles that the limitation is 2048 characters in one line after whcih the new line is expected , else the text will be truncated. I am not able to find the logic behind this truncation in default sharepoint alert functionality. Could you please give some more insights on this front? Thnaks:)  

Adding Content to masterPage Header from a Class



I was wondering if it's possible to write some code into the Header of my Master Page from within a Class?

Any help is appreciated.


relative URLs inside of email body in workflow emails?

In my auto-generated emails in workflows, I provide the reader a link to a list item on the SP site.  The problem is that I seem to have to provide an absolute URL, which of course changes between development in production.  Is there a solution for this short of editing my workflow when I move to production?  I'm on MOSS 2007 and use SP Designer.

spmetal generated class and content type (for page layout) retrieve problem


I'm working with a console application to generate my sites and subsites (hierarchy). And i've got a problem with a generated spmetal class.


this doesn't work:


static void Main(string[] args)


            string SITE = string.Concat("http://"Environment.MachineName);         



How to add content prior to using a module?


I have developed a quick module that adds some text to the bottom of every page.  This text will basically inform the user they are using my application in a test environment and save me editing the Master/Content pages for all my files.

Sadly, my code adds the string AFTER the </html> tag, which isn't very good.  Can anyone advise how to make this module add the string previous to the </body> tag, so that it gets rendered correctly according the HTML standards?

Public Class AddContent
	Implements IHttpModule, IReadOnlySessionState

	Public Sub New()
	End Sub

	Public Sub Init(ByVal ctx As HttpApplication) Implements System.Web.IHttpModule.Init
		AddHandler ctx.PreSendRequestContent, AddressOf context_PreSendRequestContent
	End Sub

	Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
	End Sub

	Private Sub context_PreSendRequestContent(ByVal sender As Object, ByVal e As EventArgs)
		HttpContext.Current.Response.Output.Write("<p>Application is running in TEST MODE!</p>")
	End Sub

End Class

Content organizer - email integration - rule "not firing"?

Hi all.  I’d be very grateful for some advice with the following problem.

I have:

1. A Records Center with the Content Organizer and email integration with Content Organizer features activated
2. A Drop-Off library, and Document Library configured for Word document content type
3. Configured the Content Organizer Settings
4. Configured the Content Organizer Rules, based on the Word document content type

I can:

1. Upload a document of the Word document content type directly into the Drop Off library and see that it is correctly routed to the Document Library in the Records Center
2. Email the same document to the Drop Off library and see that it does appear in the hidden list “Submitted e-mail records” in the Records Center

The symptom is:
1. The incoming document arrives in the “submitted e-mail records” list, but is not routed to the Document Library – it just stays there

How to change Default Email Content?


Dear All,

I have created a website in sharepoint 2007, when i add a user to my site it will send a mail to them as invitation with proper permission.

Along with this Content it will add like "What is  a Sharepoint Site?"...................etc

so i want to delete that content :)

Is it possible to change content ? if possible how i can change? Please




How to Send a Page in email body and get the response when he clicked the button?


Hi all,

I want to send an email which contain an aspx page in the mail body and when the user fill the data in the textboxex and clicked the Button the data should be stored in the SharePoint List(Button Logic Should be execute).

Please tell me how we can acheive this........

thanks in advance...............

email with right to left body



how i can send email to specialy person with right to left body?(in sharepoint2010 and visual studio)

is supported this?

Assigning a table to Email body


Hi All,

I have created a asp table as shown below.

<asp:Table ID="Table1" runat="server">
            <asp:TableRow runat="server">
                <asp:TableCell runat="server">First</asp:TableCell>
                <asp:TableCell runat="server">Second</asp:TableCell>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server">Third</asp:TableCell>
                <asp:TableCell runat="server">Fourth</asp:TableCell>


Further, I need to send the above table as Email body. Pls suggest as to

SPEmailEventReceiver event not adding email to discussion board

If I catch an "EmailReceived" event, even if the only code I execute is as follows:

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)
End Sub

The e-mail message never makes it to the discussion board itself.  If I unattach the event, everything works as expected.

Is there a way that I can ensure the message automatically makes it to the discussion board?  If not, how would I go about adding the e-mail to the board?

Thanks in advance,

How to include Full names in email with add lookup to body


Okay, the last step of my workflow is to send an email to "Created By" and HR to notify of approved vacation request. I have performed "add lookup to body" to include various information including Employee Name and Supervisor Name.  But in the resulted message the names are listed as "DOMAIN\user" Back in my list in the column settings I have the show field as Name (with presence) and have tried all others.

I researched this and found information about installing and activating "Useful Sharepoint Designer Activities" which I did install and activate it.  How do I get the full name of the people to show up in the email message that is sent?

Background Image In Workflow Custom Email Body


In my workflow I have custom email body, in my email body i want to have background image, but it seems that this tag (<td style="background-image:url()>)is not working, i can put image in my email body and it works well but background image doesn't work, Any Idea?


Modifying discussion board 'Alert me" Email Body

Hi i would like to modify the email body of alert me. I just don't like the link to modify the alerts in the body. in the alerts XML there is a variable for the entire body ( <![CDATA[$Resources:Lerts-weeklysummary;]]> ). how do i modify the content of body to remove "You can change this alert or any of your other alerts on the My Alerts on this Site page."

email body format is shown below

Alert 'English Primary Discussion - Weekly Alert' has successfully been added on 'English - Primary'.

You will receive alerts in e-mail. The timing and criteria for the alerts depend on the settings entered when the alert was added.

You can change this alert or any of your other alerts on the My Alerts on this Site page.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend