Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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??

Thnx
Posted
Updated 19-Jun-11 23:04pm
v2
Comments
R. Giskard Reventlov 20-Jun-11 4:33am    
What research have you already done for yourself? Have you read the documentation? Looked on Google?

1 solution

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...
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900