JEAF Mail provides a so called Mail Service Provider that allows to send mails using the exactly same code in every environment.
JEAF Mail Current Versions
Project Current Version Docs Maven Git JEAF Mail API Javadoc Maven Repo Git Repo JEAF Mail Impl Javadoc Maven Repo Git Repo