I am receiving e-mails set from a normal GUI client such as thunderbird or outlook, which conntain message body as String and one csv file attachment.
Using Java mail I would like to process the attachment i.e. read in the contet of the csv file into a String. Can I simply check whether the contet is a Multipart and then process the one at index 1 ( I guess e-mail body is at index 0)? Or should I check for dispositions which flags which part is an attachment? My only cocern is that if oe seds an e-mail using a regular GUI client, these flags are not set…
Any comments on what approach to take?
This JavaMail FAQ entry will help.