当前位置: 技术问答>急救!!!简单的HELLOWORLD程序,编译痛不过
iis7站长之家
急救呀!!为什么javamail总是读不了mimeType为multipart/*格式的邮件????
来源: 互联网 发布时间:2017-05-02
本文导语: 但是如果mimeType格式为text/*的时候,不会出错。。。大家帮忙呀!! 代码如下: public String getMessageTextNew() throws IOException, MessagingException { String text = ""; try{ //Object o = currentMessage.getC...
但是如果mimeType格式为text/*的时候,不会出错。。。大家帮忙呀!!
代码如下:
public String getMessageTextNew() throws IOException, MessagingException {
String text = "";
try{
//Object o = currentMessage.getContent();
!->执行到这里出错. if (currentMessage.isMimeType("text/plain") ||currentMessage.isMimeType("text/html")){
text="
return text;
}
!->执行到这里出错. if (currentMessage.isMimeType("multipart/*")){
Multipart mp = (Multipart)currentMessage.getContent();
int cnt = mp.getCount();
for (int i = 0; i
代码如下:
public String getMessageTextNew() throws IOException, MessagingException {
String text = "";
try{
//Object o = currentMessage.getContent();
!->执行到这里出错. if (currentMessage.isMimeType("text/plain") ||currentMessage.isMimeType("text/html")){
text="
"+(String)currentMessage.getContent()+"";
return text;
}
!->执行到这里出错. if (currentMessage.isMimeType("multipart/*")){
Multipart mp = (Multipart)currentMessage.getContent();
int cnt = mp.getCount();
for (int i = 0; i