Hi
I like to get Mime content of a attachment which is an email. I want to save that attachment as eml file format. Below funcation fails at { att.load(EmailMessageSchema.MimeContent); }. error is Cannot cast PropertySet to PropertyDefinitionBase.. Any ideas how to fetch that data?
AttachmentCollection attachmentsCol = emsg.getAttachments();
for (int i = 0; i < attachmentsCol.getCount(); i++) {
if(attachmentsCol.getPropertyAtIndex(i) instanceof FileAttachment){
FileAttachment attachment=(FileAttachment)attachmentsCol.getPropertyAtIndex(i);
if(attachment.getId().equals(id)){
fileType=attachment.getName().substring(attachment.getName().lastIndexOf("."));
attachment.load(name+fileType);
}
}else if(attachmentsCol.getPropertyAtIndex(i) instanceof ItemAttachment){
ItemAttachment att = (ItemAttachment) attachmentsCol.getPropertyAtIndex(i);
if(att.getId().equals(id)){
fileType =Constant.ECM_EXCHANGE_FORMAT;
//'addProp.add(new PropertySet(EmailMessageSchema.MimeContent));
att.load(EmailMessageSchema.MimeContent);
MimeContent mc =att.getItem().getMimeContent();
}
}
}