bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)
http://www.simplejavamail.org
Apache License 2.0
1.2k stars 261 forks source link
batch-processing builder-api cli-support configurable conversion dkim dmarc email high-performance jakarta-mail java java-mail javamail oauth2 outlook proxy smime smtp smtp-client spring-support

APACHE v2 License Latest Release Javadocs Codacy Java 8+

Simple Java Mail

Simple Java Mail is the simplest to use lightweight mailing library for Java, while being able to send complex emails including Batch processing and server clusters, CLI support, authenticated socks proxy(!), attachments, embedded images, custom headers and properties, robust address validation, build pattern and even DKIM signing, S/MIME support and external configuration files, Spring support and Email conversion tools (including support for Outlook).

Just send your emails without dealing with RFCs.

The Simple Java Mail library is a thin layer on top of Angus Mail (previously Jakarta Mail) that allows users to define emails on a high abstraction level without having to deal with mumbo jumbo such as 'multipart' and 'mimemessage'.

simplejavamail.org

Simple Java Mail is available in Maven Central:

<dependency>
    <groupId>org.simplejavamail</groupId>
    <artifactId>simple-java-mail</artifactId>
    <version>8.11.2</version>
</dependency>

Read about additional modules you can add here: simplejavamail.org/modules.

Latest Progress

v8.11.0 - v8.11.2

NOTE: v8.11.0 contains many (minor) dependency updates to resolve CVE issues, including:

v8.10.0 - v8.10.1

v8.9.0 (26-April-2024)

v8.8.0 - v8.8.4

NOTE: release 8.8.0 changes the default for DKIM signing from 'l-param' true to false. If you rely on this feature, you need to enable it explicitly. Refer to the DKIM documentation for the update.

v8.7.0 - v8.7.1

NOTE: this breaks the API for S/MIME related builder methods. Refer to the S/MIME documentation for the new API.

v8.6.0 - v8.6.3

NOTE: this release switches to Angus Mail which should be a transparent change, but if you encounter any issues, please report them. One known issue is that Angus, since 1.1.0, performs server identity checks by default, which was previously disabled for SMTP. If you encounter issues with this, you can disable it with mailerBuilder.verifyingServerIdentity(false) and starting from 8.8.2, this also works with SMTP transport strategy (see #495).

v8.5.0 - v8.5.1

v8.4.0 (12-December-2023)

v8.3.0 - v8.3.5

v8.2.0 (02-October-2023)

v8.1.0 - v8.1.3

v8.0.0 - v8.0.1

This release changes how Email instances are built, or more specifically, when defaults and overrides are applied. There are now overloaded build methods that provide similar behaviour as previous versions.

v7.9.0 - v7.9.1

v7.8.0 - v7.8.3

v7.7.0 - v7.7.1

7.7.0 moves the conversion of Email to MimeMessage to after a Transport instance has been selected (in case of a cluster of SMTP servers), so we can apply defaults/overrides on the Mailer level, meaning you can configure 'global' values for individual SMTP servers (like a fixed FROM per server).

v7.6.0 (05-January-2023)

v7.5.0 - v7.5.2

v7.5.1 (12-December-2022)

v7.5.0 (28-July-2022)

v7.4.0 (19-July-2022)

v7.3.0 (15-July-2022)

v7.2.0 - v7.2.1

v7.1.0 - v7.1.3

v7.0.1 - v7.0.2

v7.0.0 (2-January-2022)

It has been two years since the last major release, but 7.0.0 finally here!

What's new

Major features:

Bugfixes:

Maintenance:

About the migration

Updating to Java8/Jakarta 2.0.1 posed a challenge as the 3rd party S/MIME library java-utils-mail-smime has been abandoned/archived while developing Simple Java Mail. Furthermore, it was still under LGPL3 license while everything else is ApacheV2.

Thankfully, I obtained permissions from the maintainers -as well as original developers from decades ago on SourceForge- to take both java-utils-mail-smime and java-utils-mail-dkim under my wings at Simple Java Mail and change the licensing model! You can now post issues and pull requests here:

v6.7.0 - v6.7.6

v6.6.0 - v6.6.2

v6.5.0 - v6.5.4

This release breaks all GET/SET api regarding headers used as map (Map<String, T> -> Map<String, Collection<T>>) This release might break api in the rare case you relied on the attachment list and you have nested Outlook .msg attachments (previously omitted in the results)

v6.4.0 - v6.4.5

v6.3.0 - v6.3.2 (11-July-2020 - 12-July-2020)

v6.2.0 (9-July-2020)

This release adds the following major new feature:

v6.1.0 (5-July-2020)

v6.0.2 - v6.0.5 (21-January-2020 - 13-June-2020)

v6.0.0-rc1 - v6.0.1 (18-December-2019 - 24-January-2020)

After almost two years of development the next major release 6.0.0 is finally here! And what a doozy it is, with the following major new features:

The core library is now even smaller compared to the 5.x.x series going from 183kb to 134kb!

Here's the complete list of changes:

New features and enhancements

Bugs solved

Maintenance updates

Included changes from outlook-message-parser

A big shout-out to @dnault (runtime javadoc), @remkop (picocli) and @markenwerk (S/MIME and DKIM) for working with me to make the libraries work with JDK7+ and do what Simple Java Mail needed! Finally, a great many thanks the numerous contributors on Simple Java Mail as well as outlook-message-parser - this release would not be there without you.

v5.5.0 - v5.5.1

v5.4.0 (28-August-2019)

v5.3.0 (16-August-2019)

Note this release should have no impact, but nonetheless is a minor update, so you can determine for yourself if this update would cause issues. The release changes DKIM header canonicalization from SIMPLE to RELAXED.

v5.2.1 (16-August-2019)

v5.2.0 (7-July-2019)

Note that dependencies that switched as well have been updated as part of this change. This includes the optional DKIM library and the email validation library:

v5.1.1 - v5.1.7

v5.1.0 (21-November-2018)

v5.0.1 - v5.0.8

v5.0.0 (14-Februari-2018)

Also see the migration notes

New features

Security updates

Maintenance updates

Complete Javadoc overhaul. Navigating the Javadoc should be much more consistent now (builder API being the single public source of truth).

Bugfixes

v4.4.5 (2-September-2017)

v4.4.4 (23-August-2017)

API usability release. This relase streamlined the recipient setters, breaking backwards compatibility (but straightforward to fix)

v4.3.0 (12-August-2017)

Security and timeout release.

This version safeguards against SMTP injection attack from external values entering the library through Email instance. Also, this release introduces default/configurable timeouts for connecting, reading and writing when sending an email.

v4.2.3 (21-May-2017)

v4.2.2 (10-May-2017)

v4.2.1 (12-Feb-2017)

Patch: streamlined convenience methods for adding recipients.

v4.2.0 (12-Feb-2017)

Major feature: Using the EmailConverter you can now convert between Outlook .msg, EML, MimeMessage and Email!

Note: Starting this release, there will always be a Java6 compatible release as well versioned: "x.y.z-java6-release"

v4.1.3 (28-Jan-2017)

NOTE: ConfigLoader moved from /internal/util to /util

v4.1.2 (07-Nov-2016)

v4.1.1 (30-Jul-2016)

v4.1.0 (22-Jul-2016)

v4.0.0 (05-Jul-2016)

NOTE: All packages have been renamed to "org.simplejavamail.(..)" NOTE: Switched to Java 7

v3.1.1 (11-May-2016)

Major feature: DKIM support!

NOTE: this is the last release still using Java 6. Next release will be using Java 7. /edit: starting with 4.2.0 every release will now have a "x.y.z-java6-release" release as well

v3.0.2 (07-May-2016)

v3.0.1 (29-Feb-2016)

v3.0.0 (26-Feb-2016)

v2.5.1 (19-Jan-2016)

v2.5 (19-Jan-2016)

v2.4 (12-Aug-2015)

v2.3 (21-Jul-2015)

v2.2 (09-May-2015)

v2.1 (09-Aug-2012)

v2.0 (20-Aug-2011)

v1.9.1 (08-Aug-2011)

v1.9 (6-Aug-2011)

v1.8

v1.7 (22-Mar-2011)

Added support for SSL! (tested with gmail)

known possible issue: SSL self-signed certificates might not work (yet). Please let me know by e-mail or create a new issue

v1.6

Completed migration to Java Simple Mail project.

v1.4 (15-Jan-2011)

vX.X (26-Apr-2009)