It's also possible the HTML body includes
embedded images. They are <img> tags with a source that starts with "cid:", and the value after that matches the Content-ID of one of the attachments. What I've done for one project is use a
Pattern / Matcher pair to find all such sources, find the matching attachments, extract these attachments to a web server's file system and then replace the source to the location of the attachment on the web server. I can't give you any more details though as my employer won't allow me to share that code.