Click here to Skip to main content
11,710,472 members (84,338 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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
Edited 19-Jun-11 23:04pm
digital man at 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 at 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
0 Sergey Alexandrovich Kryukov 549
1 OriginalGriff 270
2 Peter Leow 134
3 Abhinav S 130
4 Richard MacCutchan 80
0 Abhinav S 60
1 Member 4653839 40
2 barneyman 35
3 Sergey Alexandrovich Kryukov 35
4 Member 11793820 35

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 20 Jun 2011
Copyright © CodeProject, 1999-2015
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