I've been doing this by using the following code:
if (msg.isMimeType("multipart/*"))
// this has attachment
else
// no attachment
Unfortunately this doesn't always work. When I have message that has
just the attachment and no message body, the mime type of the message is
not "multipart/*", how do I solve it for such messages?
thanks,
Ravi
> When I have message that has
> just the attachment and no message body, the mime type of the
> message is not "multipart/*", how do I solve it for such messages?
Then it does not have an attachment. What you call an attachment in
this case is just the message.
What you might want to do is to flag every mail that has a mime type,
and were the mime type different from text/plain as "having an
attachment". You might include text/html in that check, too (to be
compatible with some broken and brain dead MS mailer). Or you just
check for text/*.