Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Latest commit

 

History

History
36 lines (22 loc) · 1.64 KB

README.md

File metadata and controls

36 lines (22 loc) · 1.64 KB

lib-Mail by ITQuasar

Join the chat at https://gitter.im/ITQuasar/lib-mail Travis CI

Tag

Latest release

Maven Central

Open Issues License

Wrapper around Java Mail API to make more easy work with email in Java, and Groovy and Scala too.

Usage

To use, by now:

...
Message message = .... // javax.mail.Message
...
Email email = new Email(message);

To get recipients and subject use getEnvelope(). Envelope has methods getTo(), getSubject(), etc.

To get content use getContent(). Content has methods getTextContent(), getHtmlContent(), getAttachments(), etc.

The envelope and content parsing are made on demand (lazily). So, the headers are parsed when envelope getters are acessed, and the body when content getters are acessed. Just be sure to have an open mail session opened, as Java Mail API is lazy too.