Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 786 Bytes

README.md

File metadata and controls

31 lines (19 loc) · 786 Bytes

java-email

A simple API for building MIME messages for delivery through a JavaMail provider.

Please see the API javadoc for details. It's easy to get started:

MailSession session = ...;
Transport transport = ...;

MailMessage message = new MailMessage();
message.setTo("Mom", "[email protected]");
message.setFrom("Me", "[email protected]");
message.setCc("Dad", "[email protected]");
message.setPlainText("Happy Mother's Day!");

message.send(session, transport);

The MailMessage class makes it easy to add other things, such as an HTML version of your message.

message.setHTMLText("<p>Happy Mother's Day!</p>");

And add attachments:

File selfie = new File("selfie.jpg");
message.attach(selfie);

Building

Use Maven

mvn package