// Create the message to forward
MimeMessage forward = new MimeMessage(session);
// Fill in header
forward.setSubject(m.getSubject());
forward.setFrom(m.getFrom()[0]);
forward.addRecipient(
Message.RecipientType.TO,
new InternetAddress("EE@21cn.com","周","GB2312"));
InternetAddress[] oAddress = (InternetAddress[])m.getRecipients(Message.RecipientType.CC);
if (oAddress != null){
for (int j=0;j<oAddress.length;j++){
forward.addRecipient(
Message.RecipientType.CC,
new InternetAddress(oAddress[j].getAddress(),oAddress[j].getPersonal()));
}
}
// Create your new message part
MimeBodyPart messageBodyPart = new MimeBodyPart();
// messageBodyPart.setText("Here you go with the original message:\n\n","iso-2022-jp");
// Create a multi-part to combine the parts
Multipart multipart = new MimeMultipart();
// multipart.addBodyPart(messageBodyPart);
// Create and fill part for the forwarded content
messageBodyPart = new MimeBodyPart();
messageBodyPart.setDataHandler(m.getDataHandler());
// Add part to multi part
multipart.addBodyPart(messageBodyPart);
// Associate multi-part with message
forward.setContent(multipart);