当我尝试从电子邮件中检索消息正文时,它以半句话和奇怪的格式出现。任何帮助都会很棒...
代码:
protected void dumpPart(Part p) throws MessagingException, IOException
{
if (p.isMimeType("text/plain"))
{
if (!p.getContent().toString().equals(null))
System.out.println((String)p.getContent());
}
else if (p.isMimeType("multipart/*"))
{
Multipart mp = (Multipart)p.getContent();
for (int x = 0; x < mp.getCount(); x++)
{
dumpPart(mp.getBodyPart(x));
}
}
}
输出:
The gist of PNM's protest in RP00-626 is that we shouldn't be able to
charge a transport or fuel fee for our imbalance netting and trading
service.
I aggress with PNM that our tariff language is
vague.