private String getContentFromHTML(Part p) throws MessagingException,
IOException, DecoderException, SAXException, TikaException {
StringBuffer content = new StringBuffer("");
if (p.isMimeType("multipart/*")) {
Multipart mp = (Multipart) p.getContent();
int count = mp.getCount();
for (int i = 0; i < count; i++)
content.append(getContentFromHTML(mp.getBodyPart(i)));
} else if (p.isMimeType("text/html")) {
HtmlParser parser = new HtmlParser();
Metadata met = new Metadata();
TextContentHandler handler = new TextContentHandler(
new BodyContentHandler());