Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
I made a console application in c sharp which receive email using pop3.But i am getting a problem to strip out the email headers.
Thnx

Regards,
Vishavdeep Goyal
Posted
Comments
OriginalGriff 21-Jun-11 3:05am    
If you use the "Improve question" widget to edit your question, and post the relevant code fragments so we know what you are doing so far, we might be able to help...

 
Share this answer
 
Comments
Member 8019526 21-Jun-11 4:00am    
thnx for the reply but it is not working....
Sergey Alexandrovich Kryukov 21-Jun-11 16:12pm    
What do you mean "not working"?! You did not show your code which ***you*** failed to put at work.
--SA
Sergey Alexandrovich Kryukov 21-Jun-11 16:14pm    
Could be useful; my 5. However, I'm not sure it shows how to strip comments. I explain it in my solution, please see.
--SA
I'm not sure why you need to strip them, but the headers has simple format you can find here: http://www.ietf.org/rfc.html[^] by RFC numbers 2045 to 2049.

Basically, each header goes on a separate line with possible continuation lines. An empty line signals that comments are finishes and the next line will start the e-mail body. However, do you know how to deal with multipart emails with separate MIME declaration for each part? You certainly need this is you want to parse e-mails by your own code, but this is way more difficult than just the strip of the e-mail headers.

—SA
 
Share this answer
 
Comments
Member 8019526 21-Jun-11 22:31pm    
Hello,
Actually i am accessing email.but the problem is that i want only body of email.but my program also store the email header.
thanx,
Regards,
Vishavdeep Goyal
Sergey Alexandrovich Kryukov 22-Jun-11 14:08pm    
So what? Does my answer work for you or not?
If it explains things, please formally accept it (green button).
If not, please ask your questions.
Thanks,
--SA

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