I tried to find some answer or even a hint on how to do this, but no luck.
I want to check if there are any attachments in the email messages. But if I use the suggested code:
Object content = bPart.getContent();
if (content instanceof String) {
if (Part.ATTACHMENT.equalsIgnoreCase(bPart.getDisposition()) || StringUtils.isNotBlank(bPart.getFileName())) {
haveAttachment = true;
}
else {
emailBody = content.toString();
}
}
else if (content instanceof InputStream) {
if (Part.ATTACHMENT.equalsIgnoreCase(bPart.getDisposition()) || StringUtils.isNotBlank(bPart.getFileName())) {
haveAttachment = true;
}
}
I have to use the getContent () function in my email message, and the message is automatically marked as SEEN (read) on the server.
- , , , ? , , , getContent(), .
? , , .
!
: , getContent() SEEN?