Email files from HDD

Apr 18, 2012 at 11:41 AM

Hi,

How can I parse and read email files from HDD? 

Coordinator
Apr 18, 2012 at 11:34 PM

With your few information and I guess your requirement, Maybe like this
-------------------------------------------------
String text = File.ReadAllText("C:\\mymail.eml");
var mg = new MailMessage(text);
//See property of mg object
-------------------------------------------------

regard

Apr 19, 2012 at 10:09 AM

Hi higty,

Thank you very much for the response. It works great. I am new in the field and was looking for this solution from a couple of weeks. Actually I am working on a project where I want to receive and read emails within a web application. On the first step I am working on few sample files located on HDD. 

I will come up with few questions soon. I hope you will respond. 

Again Thanks for your effort and good response.

Regards

Tahir

Apr 30, 2012 at 12:48 PM
Edited Apr 30, 2012 at 12:50 PM

.

Apr 30, 2012 at 12:50 PM

 

Hi Again,

It works fine with many types of files. There is a problem with ".msg" files. It does not get any property (To, From, Cc, Bcc, Subject) and it gets BodyText but with HTML tags. Do you have any idea about that?

Moreover how can I read and display email files with embedded images?

Whats the method to retrieve attachments?

Thanks