Yes you are right, there is an unique id for every email in you inbox.you can retrieve the email body with this id.please check java mail API to find out how you can get this id.I hope my answer works for you.