Currently i am facing an issue wherein I need to determine the extension of the attachment file in a particular mail.The attachment file in question is an "eml" file. I need to parse mails using JavaMail and identify whether the attachment file is of type ".eml" or not.
I have a sample mail which contains an attachment of "eml" type. I am able to get the "part" object for the attachment.I have tried using
There is no requirement to assign a filename to an e-mail attachment. (You do realize that the "extension" you're asking about is simply the last part of the filename, don't you?) So if the sender doesn't assign a filename there is no way to get a filename.
However if you go back one step in your requirements, you will notice that the content type of the message is "message/rfc822". I suspect this may be what you are really looking for.