Hi,
i have tried various ways of printing the contents of a mime message, but i usually get to print only the signature. Is the MimeMessage structure a tree structure? Can you post a tip/link, etc?
Here is some sample code, that i am currently experimenting with:
...
MimeMessage msg=getMIMEMessage(new File(filename));
Object o=msg.getContent();
if (o instanceof MimeMultipart)
{
System.err.print("Multipart instance ");
MimeMultipart mm=(MimeMultipart)o;
System.err.println("containg "+mm.getCount()+" parts");
Part p1=mm.getBodyPart(0);
System.err.println("content type: "+p1.getContentType());
Part p2=mm.getBodyPart(1);
System.err.println("content type: "+p2.getContentType());
InputStreamReader isr=new InputStreamReader(p2.getInputStream());
BufferedReader br=new BufferedReader(isr);
String line=br.readLine();
String txt=line;
while (line!=null)
{
line=br.readLine();
txt+=line+"\n";
}
System.out.println(txt);
if (p2 instanceof Part)
{
System.err.println("p2 is of Part interface");
if (p2 instanceof Multipart)
{
System.err.println("p2 is of Multipart interface");
}
}
....