JMail無法讀出全部信件內容?
以下是程式片段:
MimeMultipart mp = (MimeMultipart)obj;
int imp = mp.getCount();
System.out.println("imp: "+imp);
for (int j =0; j < imp; j++)
{ temp = mp.getBodyPart(j).getContent()+" :Multipart";
System.out.println("getContent: "+j+" = "+temp);
}
得知有三個MimeMultipart
imp: 3
可以讀出第一個MimeMultipart
getContent: 0 = The original message was received at Thu, 6 Dec 2012 14:15:04 +0800
from localhost
with id qB66F4bn003844
----- The following addresses had permanent fatal errors -----
<Hi20121127@some.com>
(reason: 550 Host unknown)
----- Transcript of session follows -----
550 5.1.2 <Hi20121127@some.com>... Host unknown (Name server: some.com: host not found)
:Multipart
無法讀出第二及第三個MimeMultipart
getContent: 1 = javax.mail.util.SharedByteArrayInputStream@1028e9e :Multipart
getContent: 2 = javax.mail.internet.MimeMessage@e151a5 : Multipart
請問我應該如何第二及第三個MimeMultipart,才能順利讀出。
但願有實際經驗者可以告知。
非常的感謝您!
以下是程式片段:
MimeMultipart mp = (MimeMultipart)obj;
int imp = mp.getCount();
System.out.println("imp: "+imp);
for (int j =0; j < imp; j++)
{ temp = mp.getBodyPart(j).getContent()+" :Multipart";
System.out.println("getContent: "+j+" = "+temp);
}
得知有三個MimeMultipart
imp: 3
可以讀出第一個MimeMultipart
getContent: 0 = The original message was received at Thu, 6 Dec 2012 14:15:04 +0800
from localhost
with id qB66F4bn003844
----- The following addresses had permanent fatal errors -----
<Hi20121127@some.com>
(reason: 550 Host unknown)
----- Transcript of session follows -----
550 5.1.2 <Hi20121127@some.com>... Host unknown (Name server: some.com: host not found)
:Multipart
無法讀出第二及第三個MimeMultipart
getContent: 1 = javax.mail.util.SharedByteArrayInputStream@1028e9e :Multipart
getContent: 2 = javax.mail.internet.MimeMessage@e151a5 : Multipart
請問我應該如何第二及第三個MimeMultipart,才能順利讀出。
但願有實際經驗者可以告知。
非常的感謝您!