Search email inbox using javax.mail <p>I was trying to see if there was a way to search an email inbox from javax.mail. Say I wanted to send a query and have the it return emails to us. Can we parse returned HTML and extract data. Also, if the above is possible how would I "translate" those messages returned by that server to POP3 messages? E.g. we have extracted:</p> <pre><code>Subject: Foo Body: Bar </code></pre> <p>but to open same message using POP3 I need to know it's POP3 uid, or number. I don't think we'll be able to get UID but perhaps we can figure out the number.</p> <p>I guess the question is:</p> <p>Can I send a query to email server (such as Hotmail or Yahoo) and get returned emails?</p>