views:

51

answers:

2

Hi,

Hope someone may be able to help. What i am looking to do is create a small winform app in c# to read the content of a email from a pop account, and upload key values to a sql automatically. The email format is always the same for each email, eg,

First name : Last name : Phone number : etc...

Currently the emails are being stored in a pop 3 account however i want a way to reduce having to key the information into the sql by hand.

Can anyone advise how i would go about doing this or could recommend some guides?

Thanks. Steve

+3  A: 

I would recommend using a class like this POP3 client at CodeProject to read the mail messages.

Once you have the message content, you should be able to fairly easily parse the string, since you know the exact format. There isn't enough information to recommend the best option for this - it depends on whether it's fixed format, delimited, separate lines, etc, but using regular expressions or even String.Split should make this fairly simple.

Reed Copsey
Thanks for the quick reply. it`s fixed format everytime so this should help alot. Thanks for the link as well, i`ll check it out.
Steve
+1  A: 

We use a purchased tool Email2Db tool to process incoming email. It is inexpensive and easy to configure. I wrote custom vb scripts for our needs but a simple insert into a db would not require any coding.

Maggie
cool, thanks Maggie
Steve