当我尝试从 POP 3 邮件中获取附件时,我将它们作为 winmail.dat 获取,而不是原始附件名。如何获取原始文件名?
for (int i = 0; i < multipart.getCount(); i++)
{
BodyPart bodyPart = multipart.getBodyPart(i);
if(!Part.ATTACHMENT.equalsIgnoreCase(bodyPart.getDisposition()))
{
//do something
}
else
{
bodyPart.getFileName(); // here only get the winmail.dat
}
}