public void deleteMail(String[] mailArray, String memberId, String lastModifiedBy) {
List<PrivateMessageVO> listOfPM = new ArrayList<PrivateMessageVO>();
PrivateMessageVO pm = new PrivateMessageVO();
for (int i = 0 ; i < mailArray.length ; i++){
pm = findById(mailArray[i]);
if ((pm.getMessageToUserId().equals(memberId) && pm.getCopyMe().equals(BaseConstants.BOOLEAN_NO))
|| (pm.getMessageFromUserId().equals(memberId) && pm.getCopyMe().equals(BaseConstants.BOOLEAN_YES))){
pm.setMessageStatus(BaseConstants.PM_STATUS_DELETED);
pm.setFolderName(BaseConstants.FOLDER_TRASH);
pm.setLastModifiedBy(lastModifiedBy);
listOfPM.add(findById(mailArray[i]));
}
}
batchUpdate(listOfPM);
}