그것은 니펫 아래 작동합니다 날 것으로 보인다,하지만 "mp.getBodyPart (1) .getContent을(). toString()"반환toString을 사용하여 javamail 첨부를 구문 분석 할 수없는 이유는 무엇입니까?
첨부 파일 내용 대신
public class GMailParser {
public String getParsedMessage(Message message) throws Exception {
try {
Multipart mp = (Multipart) message.getContent();
String s = mp.getBodyPart(1).getContent().toString();
if (s.contains("pattern 1")) {
return "return 1";
} else if (s.contains("pattern 2")) {
return "return 2";
}
...
뿐만 아니라 http://stackoverflow.com/questions/5628395/javamail-parsing-email-content-cant-seem-to-get-it-to-work-message-getcont/26142591#이보기 26142591 – NoNaMe