473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Parse email in C#

sara1382
Hi,
I have to parse an email message by separating the "To", "From", "Subject" and body of the text in order to then use this for a spam filter.
I am having a difficult time figuring out how to parse the messages any suggestions???

Thanks in Advance
SaravananR
Oct 20 '08 #1
4 5141
Plater
7,872 Expert 4TB
I am not sure where you are getting your emails from, but subject, to and from are headers in the sense like:
SUBJECT: this the subject
TO: user1@domain.com; user2@domain.com
FROM: user3@domain.com
CC: userboss@domain.com
Oct 20 '08 #2
I am not sure where you are getting your emails from, but subject, to and from are headers in the sense like:
SUBJECT: this the subject
TO: user1@domain.com; user2@domain.com
FROM: user3@domain.com
CC: userboss@domain.com
Hi Plater,
Thanks for reply. I will get the emails from the Mail Server. I want to access the emails from our Mail Server. Thats my requirement,
Oct 21 '08 #3
Plater
7,872 Expert 4TB
Well if it's an exchange server, I think you can connect to it like a database, if it's outlook you can use the office interop to talk to email accounts.
Once you get the emails it should be relatively simple to parse through the string data.
Oct 21 '08 #4
jg007
283 100+
when / where are you trying to parse the emails?

do you already have an outlook style program or are you trying to use your program to connect directly to the mailbox and then run through it looking for spam?

if you are already using outlook then you could set up macro's to run when new emails are received either directly from outlook or you could use the interop stuff to interface with outlook.
Oct 21 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: chuck amadi | last post by:
Hi , Im trying to parse a specific users mailbox (testwwws) and output the body of the messages to a file ,that file will then be loaded into a PostGresql DB at some point . I have read the...
1
by: chuck amadi | last post by:
By the way list is there a better way than using the readlines() to > > >parse the mail data into a file , because Im using > > >email.message_from_file it returns > > >all the data i.e reads one...
1
by: H.L Bai | last post by:
hi, everybody i meet a parse error when i used the xml4c. any proposal is helpful. The error is following .../XMLRegionHandler.h:59 parse error before '*' .../XMLRegionHandler.h:60 parse...
6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
19
by: linzhenhua1205 | last post by:
I want to parse a string like C program parse the command line into argc & argv. I hope don't use the array the allocate a fix memory first, and don't use the memory allocate function like malloc....
3
by: Mark | last post by:
How do you parse a currency string to a decimal? I'd like to avoid having to parse the number out, removing the $ manually. That sounds like a hack. There are times that this string will be...
3
by: Bob Rundle | last post by:
I would like to get something like this to work... Type t = FindMyType(); // might be int, float, double, etc string s = "1233"; object v = t.Parse(s); This doesn't work of couse, Parse is...
2
by: probashi | last post by:
Hi, I am trying to the following: String s = "( 54.05)"; decimal d = decimal.Parse(s); when s = "( 54.05)" I what the value -54.05 and s = " 54.05" I what the value 54.05
8
by: moondaddy | last post by:
I'm writing an app in vb.net 1.1 and I need to parse strings that look similar to the one below. All 5 rows will make up one string. I have a form where a use can copy/paste data like what you...
6
by: =?Utf-8?B?RGF2aWRN?= | last post by:
Hello, I have an XML file generated from a third party application that I would like to parse. Ideally, I plan on having a windows service setup to scan various folders for XML files and parse the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.