Click here to Skip to main content
Rate this: bad
good
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??
 
Thnx
Posted 19-Jun-11 23:31pm
Edited 20-Jun-11 0:04am
CPallini325.7K
v2
Comments
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
good
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...
  Permalink  
Comments
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)



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