Click here to Skip to main content
13,054,779 members (71,490 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Everyone,
I made a application in C sharp which will retrieve email from any server.But when i will retrieve a email i got a problem. A email is printed with its html code.But i want to print only its body.How can i print only the body of email(only text part).Is their any c sharp function??

Posted 19-Jun-11 22:31pm
Updated 19-Jun-11 23:04pm
digital man 20-Jun-11 4:33am
What research have you already done for yourself? Have you read the documentation? Looked on Google?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Not specifically: if you are receiving HTML emails - and they don't have to be HTML - then the body of the email is the HTML text. Encapsulated within that HTML may be the text you are looking for, but where in the HTML will depend on the sender: it doesn't have to be just text, it can be anything valid in HTML - tables, images, text...

You could load the email into a WebBrowser control, and extract the text portion from that? Not a nice solution, but I think a console email system is a bit 1990's anyway...
Member 8019526 20-Jun-11 5:05am
Hello Sir,
Actually sir i have to make a application in c sharp which will automatically receive email and save it in txt format.What do u suggest for it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 20 Jun 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100