dcsimg
cannot read the content of the mail
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sundeep_hemraj
Posted On:   Thursday, November 24, 2005 02:06 AM

hi i am trying to read my mail in the following format for(int bp=0;bp Part part=multipart.getBodyPart(bp); if(part.getDisposition()==null) { InputStream stream=part.getInputStream(); BufferedReader rea=new BufferedReader(new InputStreamReader(stream)); int read=1; while( (read=rea.read())!=-1) { String conline=rea.readLine(); System.out.println(conline); } }//if-null closing }//for loop closing but the output i am getting is this is line 1 line 2 line 3 line 4 !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> HTML> META http-equiv=Content-Type co   More>>

hi i am trying to read my mail in the following format

			for(int bp=0;bp
			
Part part=multipart.getBodyPart(bp);
if(part.getDisposition()==null) {
InputStream stream=part.getInputStream();
BufferedReader rea=new BufferedReader(new InputStreamReader(stream));
int read=1;
while( (read=rea.read())!=-1)
{
String conline=rea.readLine();
System.out.println(conline);
}
}//if-null closing
}//for loop closing



but the output i am getting is
			
this is line 1
line 2
line 3
line 4
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
HTML>
META http-equiv=Content-Type content="text/html; charset=windows-1252">
META content="MSHTML 6.00.2900.2668" name=GENERATOR>
STYLE>
/HEAD>
BODY bgColor=#ffffff>
DIV> this is line 1
DIV> line 2
DIV> line 3
DIV> line 4



Why this HTML content is also getting printed?
kindly help me in this issue
thanks in advance    <<Less

Re: cannot read the content of the mail

Posted By:   Christopher_Koenigsberg  
Posted On:   Sunday, November 27, 2005 10:37 AM

?? but you ARE reading the content of the message. It looks like the message has a plain text part and an html text part, perhaps together in a "multipart/alternative"?



(where the same content is presented twice, first in plaintext and then in html, and the receiving mail application is supposed to show the user only the version they prefer seeing, e.g. I hate html so I always only want the plain text version).
About | Sitemap | Contact