Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello masters

i have 100+ emails in my inbox. some mails have attachments.
i need to download all emails plain text data to individual text files.
i try with this code. but it downloads all data, i.e. include attachments.
i need only mail body plain text, except attachments.

for(int i=1;i<convert.toint32(pc.getmessagecount());i++)>
{
FileInfo fi=new FileInfo(Application.StartupPath+"\\"+i+".txt");
pc.GetMessage(i).MessagePart.Save(fi);
}

getting the mail data by GetMessage(), what is the internal process done here?
is it downloading all mail message data, include attachments ?
can i directly get the plain text data, without download all mail data?

how to get mail body plain text without attachments.

so i am hungry to know the process of downloading email data.

please share your solutions.

thank you
Posted

1 solution

 
Share this answer
 

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