private static Content getContent(MimePart part) throws IOException, MessagingException { Content result = new Content(); result.body = (String) part.getContent(); result.type = part.getContentType(); return result; }