++bodyPartIndex;
}
for (int i = 0; i < attachment.size(); i++) {
SupportedAttachmentPart sp = new SupportedAttachmentPart(mp);
MailAttachment mailAttachment = (MailAttachment)attachment.elementAt(i);
sp.setFilename(mailAttachment.getFileName());
if (mailAttachment.getContentTransferEncoding().equals("base64")){
sp.setContent(new String(Base64.decode(mailAttachment.getactualContent().getBytes())));
}
else {
sp.setContent(mailAttachment.getactualContent());
}
sp.setContentType(mailAttachment.getContentType());
mp.addBodyPart(sp,bodyPartIndex);
++bodyPartIndex;
}
msg.setContent(mp);