What do u think is happening here ?

I am using the following code fr parsing the incoming MimeMesssage object. This code works fine for messages received from all servers untill now... A mail received from orgio.net ..is not able to parse the attachments. It gives the following exception
java.lang.ClassCastException: com.sun.mail.util.QPDecoderStream
at MimeMethods.handlePart(MimeMethods.java:121)
Part.getContent() method returns MimeBodyPart for all mails from all other servers (I hope) while mails from this server it throws this exception. please check the code and the print statements at the bottom. Do help me .. if u can.
package com.sdsi.mail.mtx.common;
import com.sdsi.mail.mtx.receivermtx.queue.ReceipientIDs;
import java.util.Properties;
import javax.mail.internet.MimeMessage;
import javax.mail.Message.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.Address;
import java.util.GregorianCalendar;
import java.util.Calendar;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.mail.Multipart;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeMessage;
import javax.mail.Message;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import java.io.File;
import java.io.FileReader;
import java.io.FileOutputStream;
import javax.mail.Part;
import java.io.InputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.nio.channels.FileChannel;
import java.nio.ByteBuffer;
public class MimeMethods
public MimeMessage mime;
boolean attachmentFlag=false;
public long sentDateLong=0;
public MimeMethods()
System.out.println("In MimeMethods-mime=="+mime);
public MimeMethods(MimeMessage message)
this.mime=message;
System.out.println("In MimeMethods-mime=="+mime);
public static void main(String s[])
MimeMethods mimemethods=new MimeMethods();
mimemethods.getMime("c:\\mailsystem\\temp\\1032425458377.MTXServer.N.R.296679");
//mimemethods.getMime("c:\\mailsystem\\temp\\1032444921365.MTXServer.A.U.549677");
boolean hasattachment=mimemethods.hasAttachments();
System.out.println("in-hasattachment----flag--"+hasattachment);
public boolean hasAttachments()
try
Object content = mime.getContent();
if (content instanceof Multipart)
System.out.println("In-hasAttachments-ifContent-11");
//attachmentFlag=true;
handleMultipart((Multipart)content);
else
System.out.println("In-hasAttachments-ifContent-22");
//attachmentFlag=false;
handlePart(mime);
catch(Exception e)
e.printStackTrace();
attachmentFlag=false;
return attachmentFlag;
public void handleMultipart(Multipart multipart) throws Exception
System.out.println("In MimeMethods-handleMultipart--multipart=="+multipart);
for (int i=0, n=multipart.getCount(); i<n; i++)
handlePart(multipart.getBodyPart(i));
public void handlePart(Part part) throws Exception
System.out.println("In MimeMethods-handlePart--part=="+part);
String disposition = part.getDisposition();
String contentType = part.getContentType();
try
if (disposition == null)
// When just body
// Check if plain
System.out.println("In-hasAttachments-ifContent-33");
if ((contentType.length() >= 10) && (contentType.toLowerCase().substring(0, 10).equals("text/plain"))) {
System.out.println("In-hasAttachments-ifContent-44");
String st="";
st=(String)part.getContent();
// Check if html
}else if ((contentType.length() >= 9) && (contentType.toLowerCase().substring(0, 9).equals("text/html"))) {
System.out.println("In-hasAttachments-ifContent-55");
String st="";
Object content=part.getContent();
//MimeMessage mm=(MimeMessage)part.getContent();
System.out.println("in handle PArt--551--obj-content-content.getClass()"+content.getClass());
System.out.println("in handle PArt--552--obj-content-part.getContentType()"+part.getContentType());
if (content instanceof Multipart)
handleMultipart((Multipart)content);
st=(String)part.getContent();
} else if(contentType.equals("message/rfc822")){
System.out.println("In-hasAttachments-ifContent-66");
String str="";
MimeMessage mm=(MimeMessage)part.getContent();
Object content = mm.getContent();
if (content instanceof Multipart)
handleMultipart((Multipart)content);
} else {
handlePart(mm);
} else { // Don't think this will happen
System.out.println("In-hasAttachments-ifContent-661");
MimeBodyPart bodyPartForword = (MimeBodyPart)part;
Object content = bodyPartForword.getContent();
if (content instanceof Multipart) {
handleMultipart((Multipart)content);
else if (disposition.equalsIgnoreCase(Part.ATTACHMENT))
System.out.println("In-hasAttachments-ifContent-ATTACHMENT---77");
attachmentFlag=true;
System.out.println("198 Other: " );
} else if (disposition.equalsIgnoreCase(Part.INLINE)) {
System.out.println("In-hasAttachments-ifContent-88--INLINE");
attachmentFlag=true;
System.out.println("203 Other: " );
} else {  // Should never happen
//System.out.println("Other: " + disposition);
catch(Exception e)
e.printStackTrace();
public String getFrom()
String mailFromData=null;
try
Address fromAddress[] = mime.getFrom();
for(int j=0;j<fromAddress.length; j++)
InternetAddress interAdd = (InternetAddress)fromAddress[j];
mailFromData = interAdd.getAddress();
catch(Exception e)
e.printStackTrace();
mailFromData="null";
return mailFromData;
public void setFrom(String fromId)
try
Address fromAddress=new InternetAddress(fromId);
this.mime.setFrom(fromAddress);
catch(Exception e)
e.printStackTrace();
public void setSubject(String sub)
try
mime.setSubject(sub);
catch(Exception e)
e.printStackTrace();
public String getSubject()
String mailSubjectData=null;
try
mailSubjectData = mime.getSubject();
catch(Exception e)
e.printStackTrace();
mailSubjectData="null";
return mailSubjectData;
public String getSentDate()
String toPut=null;
try
java.util.Date sentDate = mime.getSentDate();
Calendar cal = Calendar.getInstance();
cal.setTime(sentDate);
sentDateLong=cal.getTimeInMillis();
Calendar caln = Calendar.getInstance();
caln.set(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DATE),
cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE),cal.get(Calendar.SECOND));
int year = caln.get(Calendar.YEAR);
int month = caln.get(Calendar.MONTH)+1;
int day = caln.get(Calendar.DATE);
int hour = caln.get(Calendar.HOUR_OF_DAY);
int min = caln.get(Calendar.MINUTE);
int sec = caln.get(Calendar.SECOND);
String day1="";
if(cal.get(Calendar.DAY_OF_WEEK)== 1)
day1 ="Sun";
else if(cal.get(Calendar.DAY_OF_WEEK)== 2)
day1 ="Mon";
else if(cal.get(Calendar.DAY_OF_WEEK)== 3)
day1 ="Tue";
else if(cal.get(Calendar.DAY_OF_WEEK)== 4)
day1 ="Wed";
else if(cal.get(Calendar.DAY_OF_WEEK)== 5)
day1 ="Thu";
else if(cal.get(Calendar.DAY_OF_WEEK)== 6)
day1 ="Fri";
else if(cal.get(Calendar.DAY_OF_WEEK)== 7)
day1 ="Sat";
toPut = new String(year+"-"+month+"-"+day+" "+day1+" "+hour+":"+min+":"+sec);
catch(Exception e)
e.printStackTrace();
return toPut;
public String[] getToIds()
String toids[]=null;
try
Address recipientAddresses[] = mime.getRecipients(Message.RecipientType.TO);
if(recipientAddresses != null)
String recipientIDs[] = new String[recipientAddresses.length];
for(int j=0; j<recipientAddresses.length; j++)
InternetAddress iAdd = (InternetAddress)recipientAddresses[j];
recipientIDs[j] = iAdd.getAddress();
toids=recipientIDs;
return toids;
catch(Exception e)
e.printStackTrace();
return toids;
public String[] getCCIds()
String ccids[]=null;
try
Address ccAddresses[] = mime.getRecipients(Message.RecipientType.CC);
if(ccAddresses != null)
String recipientIDs[] = new String[ccAddresses.length];
for(int j=0; j<ccAddresses.length; j++)
InternetAddress iAdd = (InternetAddress)ccAddresses[j];
recipientIDs[j] = iAdd.getAddress();
ccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return ccids;
public String[] getBCCIds()
String bccids[]=null;
try
Address bccAddresses[] = mime.getRecipients(Message.RecipientType.BCC);
if(bccAddresses != null)
String recipientIDs[] = new String[bccAddresses.length];
for(int j=0; j<bccAddresses.length; j++)
InternetAddress iAdd = (InternetAddress)bccAddresses[j];
recipientIDs[j] = iAdd.getAddress();
bccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return bccids;
public void setBody(String bodyPart)
try
//String body=(String)mime.getContent();
mime.setText(bodyPart);
//body.concat("Your mail could not get delivered to the recipient");
catch(Exception e)
e.printStackTrace();
/** By using this method the user will get the Content and the attachments
* for a mail/ Forwarded mail.
public boolean writeMime(String mailMessage, String receivers[],String senderId)
MimeMessage message=null;
try
System.out.println("In-EnQueuer--writeMime()");
String host = " ";
Properties props = System.getProperties();
props.put("mail.smtp.host",host);
Session session = Session.getInstance(props, null);
FileOutputStream fos=new FileOutputStream("c://MTXServer//receiver//queue//mimefolder"+"//"+System.currentTimeMillis());
message = new MimeMessage(session);
int size=receivers.length;
Address address[]=InternetAddress.parse(ArrayToString(receivers));
//message.setRecipients(Message.RecipientType.TO,address);
message.setFrom(address[0]);
message.setSubject("Hello Avanish Sub for Testing set in EnQueuer");
int num=(int)(System.currentTimeMillis()/100);
GregorianCalendar date=new GregorianCalendar();
message.setText(mailMessage);
//message.setSentDate();
message.writeTo(fos);
System.out.println("In-Dequeuer-after-Mime-message Id==" + message.getMessageID());
fos.close();
catch(Exception e)
System.out.println("Exception in Reading file" + e);
return true;
public String ArrayToString(String receivers[])
String str=null;
StringBuffer strbuff=new StringBuffer();
int size=receivers.length;
for(int i = 0; i < size; i++)
strbuff.append(receivers);
return strbuff.toString();
public MimeMessage getMime(String filePath)
StringBuffer mailMessage = new StringBuffer();
MimeMessage message = null;
try
System.out.println("In-MimeMethods-getMime()-filePath--" + filePath);
FileInputStream fis = new FileInputStream(filePath);
String host = " ";
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getInstance(props, null);
message = new MimeMessage(session, fis);
System.out.println("In-MimeMethods-getMime()-after-Mime-message Id==" + message.getMessageID());
this.mime=message;
fis.close();
catch(Exception e)
e.printStackTrace();
return message;
public String getMailContent(String filePath)
StringBuffer mailMessage=new StringBuffer();
try
FileReader fread = new FileReader(filePath);
BufferedReader br = new BufferedReader(fread);
String s1;
while((s1 = br.readLine()) != null)
mailMessage.append(s1);
mailMessage.append("\n");
br.close();
fread.close();
catch(Exception e)
e.printStackTrace();
return new String(mailMessage);
//This is whatever i get when i am printing using print statements.
*In-MimeMethods-getMime()-filePath--c:\mailsystem\temp\1032425458377.MTXServer.N.R.296679
In-MimeMethods-getMime()-after-Mime-message Id==<[email protected]>
In-hasAttachments-ifContent-11
In MimeMethods-handleMultipart--multipart==javax.mail.internet.MimeMultipart@b1c5fa
In MimeMethods-handlePart--part==javax.mail.internet.MimeBodyPart@971afc
In-hasAttachments-ifContent-33
In-hasAttachments-ifContent-55
in handle PArt--551--obj-content-content.getClass()class com.sun.mail.util.QPDecoderStream
in handle PArt--552--obj-content-part.getContentType()text/html;
In MimeMethods-handlePart--part==javax.mail.internet.MimeBodyPart@e5855a
In-hasAttachments-ifContent-ATTACHMENT---77
198 Other:
in-hasattachment----flag--true
java.lang.ClassCastException: com.sun.mail.util.QPDecoderStream
at MimeMethods.handlePart(MimeMethods.java:121)
at MimeMethods.handleMultipart(MimeMethods.java:89)
at MimeMethods.hasAttachments(MimeMethods.java:68)
at MimeMethods.main(MimeMethods.java:56)

I am having this exact problem now. I am glad if anyone has a solution for this. Thanks a million for anyone who can help me! I am pretty desperate here.
I am using the following code fr parsing the incoming
MimeMesssage object. This code works fine for messages
received from all servers untill now... A mail
received from orgio.net ..is not able to parse the
attachments. It gives the following exception
java.lang.ClassCastException:
com.sun.mail.util.QPDecoderStream
at
at MimeMethods.handlePart(MimeMethods.java:121)
Part.getContent() method returns MimeBodyPart for all
mails from all other servers (I hope) while mails from
this server it throws this exception. please check the
code and the print statements at the bottom. Do help
me .. if u can.
package com.sdsi.mail.mtx.common;
import
com.sdsi.mail.mtx.receivermtx.queue.ReceipientIDs;
import java.util.Properties;
import javax.mail.internet.MimeMessage;
import javax.mail.Message.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.Address;
import java.util.GregorianCalendar;
import java.util.Calendar;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.mail.Multipart;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeMessage;
import javax.mail.Message;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import java.io.File;
import java.io.FileReader;
import java.io.FileOutputStream;
import javax.mail.Part;
import java.io.InputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.nio.channels.FileChannel;
import java.nio.ByteBuffer;
public class MimeMethods
public MimeMessage mime;
boolean attachmentFlag=false;
public long sentDateLong=0;
public MimeMethods()
System.out.println("In
tln("In MimeMethods-mime=="+mime);
public MimeMethods(MimeMessage message)
this.mime=message;
System.out.println("In
tln("In MimeMethods-mime=="+mime);
public static void main(String s[])
MimeMethods mimemethods=new MimeMethods();
mimemethods.getMime("c:\\mailsystem\\temp\\10324254583
7.MTXServer.N.R.296679");
//mimemethods.getMime("c:\\mailsystem\\temp\\103244492
365.MTXServer.A.U.549677");
boolean
boolean hasattachment=mimemethods.hasAttachments();
System.out.println("in-hasattachment----flag--"+hasatt
chment);
public boolean hasAttachments()
try
Object content = mime.getContent();
if (content instanceof Multipart)
System.out.println("In-hasAttachments-ifContent-11");
//attachmentFlag=true;
handleMultipart((Multipart)content);
else
System.out.println("In-hasAttachments-ifContent-22");
//attachmentFlag=false;
handlePart(mime);
catch(Exception e)
e.printStackTrace();
attachmentFlag=false;
return attachmentFlag;
public void handleMultipart(Multipart multipart)
rt) throws Exception
System.out.println("In
("In
MimeMethods-handleMultipart--multipart=="+multipart);
for (int i=0, n=multipart.getCount(); i<n;
); i<n; i++)
handlePart(multipart.getBodyPart(i));
public void handlePart(Part part) throws
ows Exception
System.out.println("In
("In MimeMethods-handlePart--part=="+part);
String disposition = part.getDisposition();
String contentType = part.getContentType();
try
if (disposition == null)
// When just body
// Check if plain
System.out.println("In-hasAttachments-ifContent-33");
if ((contentType.length() >= 10) &&
gth() >= 10) &&
(contentType.toLowerCase().substring(0,
10).equals("text/plain"))) {
System.out.println("In-hasAttachments-ifContent-44");
String st="";
st=(String)part.getContent();
// Check if html
}else if ((contentType.length() >= 9)
.length() >= 9) &&
(contentType.toLowerCase().substring(0,
9).equals("text/html"))) {
System.out.println("In-hasAttachments-ifContent-55");
String st="";
Object
Object
Object content=part.getContent();
//MimeMessage
//MimeMessage
//MimeMessage mm=(MimeMessage)part.getContent();
System.out.println("in
System.out.println("in handle
ndle
PArt--551--obj-content-content.getClass()"+content.getC
ass());
System.out.println("in
System.out.println("in handle
ndle
PArt--552--obj-content-part.getContentType()"+part.getC
ntentType());
if (content instanceof
if (content instanceof Multipart)
handleMultipart((Multipart)content);
st=(String)part.getContent();
} else
} else
} else if(contentType.equals("message/rfc822")){
System.out.println("In-hasAttachments-ifContent-66");
String str="";
MimeMessage
MimeMessage
MimeMessage mm=(MimeMessage)part.getContent();
Object content =
Object content = mm.getContent();
if (content instanceof
if (content instanceof Multipart)
handleMultipart((Multipart)content);
} else {
handlePart(mm);
} else { // Don't think this will
hink this will happen
System.out.println("In-hasAttachments-ifContent-661");
MimeBodyPart
MimeBodyPart bodyPartForword =
yPartForword = (MimeBodyPart)part;
Object content =
Object content =
content = bodyPartForword.getContent();
if (content instanceof
if (content instanceof Multipart) {
handleMultipart((Multipart)content);
else if
else if
(disposition.equalsIgnoreCase(Part.ATTACHMENT))
System.out.println("In-hasAttachments-ifContent-ATTACH
ENT---77");
attachmentFlag=true;
System.out.println("198 Other: " );
} else if
else if (disposition.equalsIgnoreCase(Part.INLINE)) {
System.out.println("In-hasAttachments-ifContent-88--IN
INE");
attachmentFlag=true;
System.out.println("203 Other: "
ntln("203 Other: " );
} else {  // Should never happen
//System.out.println("Other: " +
println("Other: " + disposition);
catch(Exception e)
e.printStackTrace();
public String getFrom()
String mailFromData=null;
try
Address fromAddress[] = mime.getFrom();
for(int j=0;j<fromAddress.length; j++)
InternetAddress interAdd =
ress interAdd = (InternetAddress)fromAddress[j];
mailFromData = interAdd.getAddress();
catch(Exception e)
e.printStackTrace();
mailFromData="null";
return mailFromData;
public void setFrom(String fromId)
try
Address fromAddress=new
Address=new InternetAddress(fromId);
this.mime.setFrom(fromAddress);
catch(Exception e)
e.printStackTrace();
public void setSubject(String sub)
try
mime.setSubject(sub);
catch(Exception e)
e.printStackTrace();
public String getSubject()
String mailSubjectData=null;
try
mailSubjectData = mime.getSubject();
catch(Exception e)
e.printStackTrace();
mailSubjectData="null";
return mailSubjectData;
public String getSentDate()
String toPut=null;
try
java.util.Date sentDate =
sentDate = mime.getSentDate();
Calendar cal = Calendar.getInstance();
cal.setTime(sentDate);
sentDateLong=cal.getTimeInMillis();
Calendar caln = Calendar.getInstance();
caln.set(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH
,cal.get(Calendar.DATE),
cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE)
cal.get(Calendar.SECOND));
int year = caln.get(Calendar.YEAR);
int month = caln.get(Calendar.MONTH)+1;
int day = caln.get(Calendar.DATE);
int hour =
int hour = caln.get(Calendar.HOUR_OF_DAY);
int min = caln.get(Calendar.MINUTE);
int sec = caln.get(Calendar.SECOND);
String day1="";
if(cal.get(Calendar.DAY_OF_WEEK)== 1)
day1 ="Sun";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 2)
day1 ="Mon";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 3)
day1 ="Tue";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 4)
day1 ="Wed";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 5)
day1 ="Thu";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 6)
day1 ="Fri";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 7)
day1 ="Sat";
toPut = new
toPut = new String(year+"-"+month+"-"+day+" "+day1+"
"+hour+":"+min+":"+sec);
catch(Exception e)
e.printStackTrace();
return toPut;
public String[] getToIds()
String toids[]=null;
try
Address recipientAddresses[] =
dresses[] =
mime.getRecipients(Message.RecipientType.TO);
if(recipientAddresses != null)
String recipientIDs[] = new
ientIDs[] = new String[recipientAddresses.length];
for(int j=0;
for(int j=0; j<recipientAddresses.length; j++)
InternetAddress iAdd =
ernetAddress iAdd =
(InternetAddress)recipientAddresses[j];
recipientIDs[j] =
recipientIDs[j] = iAdd.getAddress();
toids=recipientIDs;
return toids;
catch(Exception e)
e.printStackTrace();
return toids;
public String[] getCCIds()
String ccids[]=null;
try
Address ccAddresses[] =
ses[] = mime.getRecipients(Message.RecipientType.CC);
if(ccAddresses != null)
String recipientIDs[] = new
ientIDs[] = new String[ccAddresses.length];
for(int j=0; j<ccAddresses.length;
dresses.length; j++)
InternetAddress iAdd =
ernetAddress iAdd = (InternetAddress)ccAddresses[j];
recipientIDs[j] =
recipientIDs[j] = iAdd.getAddress();
ccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return ccids;
public String[] getBCCIds()
String bccids[]=null;
try
Address bccAddresses[] =
dresses[] =
mime.getRecipients(Message.RecipientType.BCC);
if(bccAddresses != null)
String recipientIDs[] = new
ientIDs[] = new String[bccAddresses.length];
for(int j=0; j<bccAddresses.length;
dresses.length; j++)
InternetAddress iAdd =
ernetAddress iAdd = (InternetAddress)bccAddresses[j];
recipientIDs[j] =
recipientIDs[j] = iAdd.getAddress();
bccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return bccids;
public void setBody(String bodyPart)
try
//String body=(String)mime.getContent();
mime.setText(bodyPart);
//body.concat("Your mail could not get
not get delivered to the recipient");
catch(Exception e)
e.printStackTrace();
/** By using this method the user will get the
the Content and the attachments
* for a mail/ Forwarded mail.
public boolean writeMime(String mailMessage,
ge, String receivers[],String senderId)
MimeMessage message=null;
try
System.out.println("In-EnQueuer--writeMime()");
String host = " ";
Properties props =
ies props = System.getProperties();
props.put("mail.smtp.host",host);
Session session =
n session = Session.getInstance(props, null);
FileOutputStream fos=new
eam fos=new
FileOutputStream("c://MTXServer//receiver//queue//mimef
lder"+"//"+System.currentTimeMillis());
message = new MimeMessage(session);
int size=receivers.length;
Address
Address
ess
address[]=InternetAddress.parse(ArrayToString(receivers
//message.setRecipients(Message.RecipientType.TO,addre
s);
message.setFrom(address[0]);
message.setSubject("Hello Avanish Sub for
ish Sub for Testing set in EnQueuer");
int
int
int num=(int)(System.currentTimeMillis()/100);
GregorianCalendar date=new
ar date=new GregorianCalendar();
message.setText(mailMessage);
//message.setSentDate();
message.writeTo(fos);
System.out.println("In-Dequeuer-after-Mime-message
age Id==" + message.getMessageID());
fos.close();
catch(Exception e)
System.out.println("Exception in Reading
in Reading file" + e);
return true;
public String ArrayToString(String receivers[])
String str=null;
StringBuffer strbuff=new StringBuffer();
int size=receivers.length;
for(int i = 0; i < size; i++)
strbuff.append(receivers);
return strbuff.toString();
public MimeMessage getMime(String filePath)
StringBuffer mailMessage = new
e = new StringBuffer();
MimeMessage message = null;
try
System.out.println("In-MimeMethods-getMime()-filePath-
" + filePath);
FileInputStream fis = new
m fis = new FileInputStream(filePath);
String host = " ";
Properties props =
ies props = System.getProperties();
props.put("mail.smtp.host", host);
Session session =
n session = Session.getInstance(props, null);
message = new MimeMessage(session, fis);
System.out.println("In-MimeMethods-getMime()-after-Mim
-message Id==" + message.getMessageID());
this.mime=message;
fis.close();
catch(Exception e)
e.printStackTrace();
return message;
public String getMailContent(String filePath)
StringBuffer mailMessage=new StringBuffer();
try
FileReader fread = new
fread = new FileReader(filePath);
BufferedReader br = new
er br = new BufferedReader(fread);
String s1;
while((s1 = br.readLine()) != null)
mailMessage.append(s1);
mailMessage.append("\n");
br.close();
fread.close();
catch(Exception e)
e.printStackTrace();
return new String(mailMessage);
//This is whatever i get when i am printing using
print statements.
*In-MimeMethods-getMime()-filePath--c:\mailsystem\temp
1032425458377.MTXServer.N.R.296679
In-MimeMethods-getMime()-after-Mime-message
Id==<[email protected]>
In-hasAttachments-ifContent-11
In
MimeMethods-handleMultipart--multipart==javax.mail.inte
net.MimeMultipart@b1c5fa
In
MimeMethods-handlePart--part==javax.mail.internet.MimeB
dyPart@971afc
In-hasAttachments-ifContent-33
In-hasAttachments-ifContent-55
in handle
PArt--551--obj-content-content.getClass()class
com.sun.mail.util.QPDecoderStream
in handle
PArt--552--obj-content-part.getContentType()text/html;
In
MimeMethods-handlePart--part==javax.mail.internet.MimeB
dyPart@e5855a
In-hasAttachments-ifContent-ATTACHMENT---77
198 Other:
in-hasattachment----flag--true
java.lang.ClassCastException:
com.sun.mail.util.QPDecoderStream
at
at MimeMethods.handlePart(MimeMethods.java:121)
at
at
at MimeMethods.handleMultipart(MimeMethods.java:89)
at
at
at MimeMethods.hasAttachments(MimeMethods.java:68)
at MimeMethods.main(MimeMethods.java:56)

Similar Messages

  • I had about 17 tabs open on my browser. I clicked a link to open another one and when the tab opened the other tabs disappeared. What happened here?

    I had 17 tabs open. When I clicked a link to open a new tab all the other tabs disappeared. I thought a new window had been opened instead, but this is not the case there is only one window open on my mozilla browser. If I try to close the window I get a message that says there are 26 tabs opened, I opened 9 more tabs. Can anybody tell me what is going on here or how I might figure this out?
    Also, when I close a tab and try to reopen the tab using the right click menu, the 'undo closed tab' menu is disabled. What happened here? Can anybody tell me how to re-enable it?

    I've seen some occasional glitches with windows losing the toolbar area, but not one that disturbing.
    If you click and drag down on the 18th tab enough to tear it off into a new window (and possibly the same for the other newer tabs you opened), can you get the 17 tabs to re-appear in the first window? If not, I'm not sure there is a way to mend the window. If it's NOT a private browsing session, you might have to use Firefox > Exit (or File > Exit) and restore your session to get a working window. That won't work with a private window...
    As a backstop, you might also right-click a tab in the window > Bookmark All Tabs before ending your session. (Because session cookies and other transient data are not preserved when you reload bookmarks, this isn't as effective as restoring a session. On the other hand, bookmark storage is less fragile than session data storage.)
    Regarding Undo Close Tab, are the closed tabs listed on the History menu under Recently Closed Tabs? If so, that context menu item definitely should be enabled.

  • What is happening here? In FF ok, IE not

    what is happening here? I have a div that is lining up
    horizontally 300px to the right in IE and is pushing out page not
    seeming to abide by the wrapper div it's in. I have tried it with a
    clear and without on the div itself. It is the object that is just
    below the navigation buttons - different navigation -lines up to
    the right in IE
    http://www.marijuanalife.com/medicalmarijuana.html
    an example of where the object should be placed is on the
    home page.

    HOLY INLINE STYLES!!! Yikes!
    ...it looks like your a victim of IE double margin bug. See
    http://www.maxdesign.com.au/presentation/workshop/slide49.htm
    =========================
    And... what I always say:
    "write it for FireFox then hack it for IE."
    Use the right
    DocType
    Validate your Markup
    Validate your CSS
    Why you want to
    validate
    Don't
    use tables for layout

  • I have iOS7 on my iPhone4. I turned on the Voice Over option and now my phone is not working at all. At first it was freezing and not accepting any commands. Now all I have is a blank sceen. I can't get back into it. Any ideas what happened here?

    I have iOS7 on my iPhone4. I turned on the Voice Over option and now my phone is not working at all. At first it was freezing and not accepting any commands. Now all I have is a blank sceen. I can't get back into it. Any ideas what happened here?

    Hi Jeffny01,
    If your iPhone is not responding, you may find the following article helpful:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Regards,
    - Brenden

  • What's happening here: iCloud Photos preparing photos for 'Photos' app?

    This morning I came back from a weekend trip to Prague, where I took a number of photos with my iPhone 6. On my Mac I fired up iCloud Photos to see if everything was imported properly. That was about an hour ago. Since then I am presented with this screen, saying something like:
    "Welcome to Photos app. 
    With Photos app you may save your whole iCloud Photo Library ...
    Preparing photos ... This may take a few minutes.
    ... will be continued when you leave iCloud.com."
    However, with Yosemite 10.10.2 I don't have the new Photos app for Mac on my iMac!
    Now what is happening here?

    I even liked Apples error messages , because most of them were so helpful ... But now the smart guys at Apple seem to be following a more obfuscating strategy, at least sometimes.
      I suspect the maintenance work on iCloud Photo Library this weekend has been in preparation for the big life event today - then all will be revealed:   http://www.apple.com/live/

  • What does "extracted channel PDF" mean and why does it continually duplicate on my desktop?  I think it happens when I move a file in Finder to another file and when I copy some web files.  How do I avoid this on my Mac (Mavericks)?  Thanks for your help!

    What does "extracted channel PDF" mean and why does it continually duplicate on my desktop?  I think it happens when I move a file in Finder to another file and when I copy some web files.  I have to immediately move to trash all the duplications on my desktop.  How do I avoid this on my Mac (Mavericks)?  Thanks for your help!

    What application is set to open PDF files? If you CNTRL click on the file and open with Preview does the problem occur?
    If not change the default application to open PDF files to Preview.
    You can do this by highlighting the file and either use CMD i or Get Info , this will open a window with the info on the file with an option to change the application that opens the file.
    That's all I can think of.

  • My IPhone all of a sudden pops up saying sim card failed. I turn it off and turn it back on and it works but the next day it happens again. what do you think is wrong with it?

    My IPhone all of a sudden pops up saying sim card failed. I turn it off and turn it back on and it works but the next day it happens again. what do you think is wrong with it?

    Hello brittbend
    Check out the article to further troubleshoot your SIM card issues with your iPhone.
    iPhone: Troubleshooting No SIM
    http://support.apple.com/kb/TS4148
    Regards,
    -Norm G.

  • ICloud error message on iPhone saying I don't have enough space to store photos when in fact I have 1.5gb free and my photo library on my phone only has 22 photos. What's happening here and how to I fix this?

    I get an error on my iPhone saying that iCloud photo library storage has run out of space and it will stop uploading photos from my phone. However, my iCloud has 1.5gb of free storage and my photo library only has about 22 photos. So, what's happening here?

    Are you using iCloud photo library beta.
    Are any of your photos actually video.

  • What is happening here?? TextField problem.

    I'm not new to this and this is driving me crazy.  Can someone please look at this and tell me what I am doing wrong.  There is a Font named Arial embeded in my library, set to export for AS.  This is the relevent part of my document class.  All this does is create a textfield, add it to stage, set the text, load an xml file then attempt to change the text in the text field.  But the text does not change.
    public class Main extends MovieClip {
            public static const EASE_TYPE: Function = gs.easing.Sine.easeIn;
            public static const XML_PATH: String = "EventData.xml";
            public static const TWEEN_TIME: Number = .5;
            public var _messageField: TextField;
            private var _xmlLoader: URLLoader;
            private var _currentIndex: Number;
            private var _messages: Array;
            private var _times: Array;      
            private var _timer: Timer;
            public function Main(): void {
                stage.align = StageAlign.TOP_LEFT;
                stage.scaleMode = StageScaleMode.EXACT_FIT;
                init();
            private function init(): void {
                _times = new Array();
                _messages = new Array();
                _currentIndex = -1;
                _messageField = new TextField();
                _messageField.selectable = true;
                _messageField.width = 955;
                _messageField.x = 15;
                _messageField.y = 0;
                _messageField.defaultTextFormat = new TextFormat( new Arial().fontName, 12, 0xFFFFFF, false, false, false, null, null, TextFormatAlign.LEFT);
                _messageField.antiAliasType = AntiAliasType.ADVANCED;
                _messageField.embedFonts = true;
                this.addChild(_messageField);
                _messageField.text = "Test 1 2 3 . . .";
                    //  Load the xml file containing messages and times to display them.
                _xmlLoader = new URLLoader();
                _xmlLoader.addEventListener(Event.COMPLETE, onXMLload);
                _xmlLoader.load(new URLRequest(XML_PATH));
            private function onXMLload(e: Event): void {
                trace("XML Loaded");
                _messageField.text =". . . 3 2 1 tseT";
                trace( _messageField.text);
    At this point when I run this, I get a trace of "XML Loaded" and ". . . 3 2 1 tesT"  but me text field still says "Test 1 2 3 . . ." when it should say ". . . 3 2 1 tesT"  Why would this happen?   It's as if the text field is not updating.  I wrote this project using CS4 and it worked fine. I am now opening it/running it with CS5, if that matters...
    Any help would be appreciated!

    Hey Kglad, thanks for the response.
    onXMLload() is a method of class Main and _messageField is a member of Class Main.  What specificly do think could be out of scope.  The trace statement for _messageField.text displays the new value, but the swf is still showing the old .text value.
    As far as I know, you can't add a URLLoader to the display list.  It is not a display object, nor does it extend a display object.  How would I go about doing this?

  • I have a MacBook running OS X v10.6.8 and I'm trying to upgrade to Mouton Lion but I can"t download it from the app store. It says I need a intel core duo which i have. does anyone know whats happening here?

    I have a MacBook running OS X v10.6.8 and I'm trying to upgrade to Mouton Lion but I can"t download it from the app store. It says I need a intel core duo which i have. does anyone know whats happening here?

    Check that your computer is compatible with Mountain Lion.
    To check the model number hold down the option/alt key, go to the Apple menu and select System Information.
    MacBook (Late 2008 Aluminum, or Early 2009 or newer) model number 5,1 or higher
    MacBook Pro (Mid/Late 2007 or newer) model number 3,1 or higher
    Your Mac needs:
    OS X v10.6.8 or OS X Lion already installed
    2 GB or more of memory (More is better - 4 GB minimum seems to be the consensus)
    8 GB or more of available space
    If your computer isn't compatible, you might be able to upgrade to Lion. 
    Computer Compatibility - Lion
    Check to make sure your applications are compatible. PowerPC applications are no longer supported.      
    Application Compatibility
    You can also check which applications are PowerPC by going to the  menu, select About this Mac, click on More info…, then click System Report and select Software/Applications.

  • HT4972 after upgrading my iphone4 to ios7.04, the 'restore' in itunes seems to be going round in circles resulting in the iphone wanting to continually 'restore' every time. Whats happening here?

    after upgrading my iphone4 to ios7.04, the 'restore' in itunes seems to be going round in circles resulting in the iphone wanting to continually 'restore' every time. Whats happening here?

    Hello Filbert,
    Thank you for providing the details of the issue you are experiencing with your iPhone wanting to continually restore.  I found an article with steps to address the issue you described:
    Restore loop (being prompted to restore again after a restore successfully completes)
    Troubleshoot your USB connection. If the issue persists, out-of-date or incorrectly configured third-party security software may be causing this issue. Please try to troubleshoot security software issues.
    You can find the full article here:
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Location of profile -- need to understand what happened here

    I just resolved a data recovery crisis with my bookmarks. Although the crisis is over, I don't understand an important aspect of what happened, and I need to resolve this to be entirely confident of my data's safety.
    Last week my computer contracted a virus. My attempts to remove it have been unsuccessful so far, so I fell back to an alternate version of Windows XP that I keep on my computer for that purpose. I have a separate data disk and configure all of my applications to store their data there, so this should be a nearly complete workaround -- all I lack is new software that I've installed since I created the backup partition.
    As I checked out the system after booting, I looked at my Firefox bookmark file and was flabbergasted to find that its time stamp was over three years old.
    I did some research and discovered that when Firefox went to version 3 it replaced the bookmark file with a database stored in a "profile" in the Application Data directory. I wasn't aware of that, so I never reconfigured Firefox to move the profile to my data disk.
    This looked very, very bad. It looked like I'd said goodbye to all the bookmarks I've collected since I created the backup system until I got my infected system working again.
    To make the best of it, I deleted the useless bookmark file and moved the Firefox profile from my system disk to my data disk, where it should have been all along.
    Then I started Firefox (this system is running version 4) and found that all of my bookmarks were there, right up to the one that I added yesterday with instructions for removing the particular virus I'm dealing with.
    How did it do that?
    I first thought there must be another profile on the data disk, but I searched the whole disk for one of the file names in the profile, and found only the one I had just created. Later I realized that even if there were another profile, that wouldn't explain what had happened. Firefox is now using the one that I just created -- I checked the timestamps to confirm that they were being updated -- and I copied it from a system drive in a partition that hasn't been used for months. I'm delighted to have all of my bookmarks, but they seem to arrived where I need them by magic. What could have happened here?

    auscompgeek, I appreciate your effort to help. Either your response doesn't address the question, or I don't understand it.
    Here's how it looks to me: places.sqlite is part of the profile, i.e., it is one of the files in the directory that contains the profile. I've explained what happened to that directory. The fact that the bookmarks are stored in this particular file is true, but doesn't explain anything.
    I searched my data disk for this file on the chance that there was a stray copy of it somewhere, not in a complete profile directory that contained the file I originally searched for. I found it only in the new profile that I created after discovering the problem.
    So this issue still appears to be unresolved.

  • Did you know that Verizonwireless is saving your checking account information when you pay your bill by check and then making it part of your "MyVerizon"? This means of course if they get hacked that information could be compromised. What do you think of

    Did you know that Verizonwireless is saving your checking account information when you pay your bill by check and then making it part of your "MyVerizon"  without you adding it? This means of course if they get hacked that information could be compromised. What do you think of this?

    Credit card and debit card and checking and savings information is encrypted so it is possible to be hacked, but the odds are greater to get hit by the Love Boat then to have a wide scale hack.
    Oh yes they do happen, Bank of America, Chase, Citibank, Target and quite a few others. But in all the years I have paid my invoice with saved card information I never been hacked.
    You use good passwords and the risk is minimal.
    Good Luck

  • I am traveling in Chile, South America. I purchased an Entel sym card and I can make and receive phone calls, but the internet only works on WiFi. Do I need to region unlock or what? I willl only be here for A month and a half so I don't want to buy a pho

    I am traveling in Chile, South America. I purchased an Entel sym card and I can make and receive phone calls, but the internet only works on WiFi. Do I need to region unlock or what? I willl only be here for A month and a half so I don't want to buy a phone. Any suggestions?

    Most of the current Apple Intel based computers are comparable in CPU speed. I don't think it is so much the model of laptop as it is the memory, and storage capacity of the machine. If you are going to use FCP on a regular basis, perhaps as a professional or semi-professional, then you should think about the maximum memory and a very large capacity internal disk drive. For instance, one hour of finished compressed video will take up about 1.5 to 2Gbytes of disk space. If you add up the raw footage and still imagery and audio, you'll use up your disk drive capacity real quick. So a hard disk on the order of 750Gbytes @ 7200rpms might be good for video editing. 5400RPMs might be slow to rendering times. Rendering a video might take up a lot of memory so more memory is better e.g. 8Gbytes.
    As a rule of thumb, once you get to about 80% of your disk drive or memory you'll see degradation of performance.
    You can check out macsales.com. THey have a menu system that will allow you to pick and choose from various alternatives. BTW, it's been said that although Macs are typically spec'd at a certain memory size, macsales.com found that Apple computers will actually support higher memory levels. That is, if 4Gbytes are spec'd, some machines support 6Gbytes. macsales.com will provide the guidance for you.
    You might also consider buying an external disk e.g. 500Gbytes to carry around with you for back-up or transport to another machine.

  • Search by Problem/Issue in BTK, what do you think??

    Would Bug Toolkit be more effective in identifying bugs if the tool provided you with an option to search by inputting the problem or issue you are facing with your device/network in addition to keeping the existing options to search by product or Bug ID?

    I think that would be a very good idea.
    I was also thinking of some other things that might be good with searching for bugs that may affect the user.
    Here is what I was thinking and please everyone feel free to chime in.
    What I would like to be able to do is put in what piece of equipment I have, the IOS level I am running, paste in the out put of Show Inventory, and then have it take me to all bugs that only relate to my setup. And then I would like to be able to filter out things or services I do not use with maybe just check boxes and then get the results that not only affect my exact equipment but the features I use. This would be very helpful not only when I run into a problem but also when I would like to upgrade to another IOS. And even better would be the ability to save my equipment as I input it for future checks and maybe even alert me when something may affect my equipment.
    Mike

Maybe you are looking for

  • I want to read calibration data from a file

    I have some calibration data from an experiment. There are 14 channels and the data is arranged in a spreadsheet 14 rows x 4 columns, where each column is a different constant from a best-fit equation of the form y = b1 + b2.x1 + b3.x2 + b4.x1.x2, pe

  • Discussions login doesn't allow user to paste password

    Hi all, is it just me or does the discussions.apple.com not allow you to paste your password when signing in? Seems a bit of a security issue leaving you open to keyloggers....

  • Bug in DatagramChannel close?

    The following code leaves an open (unbound UDP) socket on Linux and Solaris with J2SE 1.4.2_08 and JDK 1.5.0_03. DatagramChannel dc = DatagramChannel.open(); dc.socket().bind(new InetSocketAddress(12345)); dc.close(); Is this a bug in Java or am I mi

  • Itunes is not reading 3rd generation ipod. help please.

    ok so here is the deal. i just bought a 3rd generation ipod for my lil sister and itunes does not read it at all. but i have a 2nd generation ipod myself and it works just fine. i have done the 5 R thing and it still does not work. anyone have any su

  • Trouble signing into my flickr account

    Hi, When I choose "create from an image" from Kuler and then try to login to flickr -  Flickr returns the following error: Oops! The API key or signature is invalid. An external application has requested your login credentials and permission to perfo