JEAF Mail provides a so called Mail Service Provider that allows to send mails using the exactly same code in every environment.
Overview about latest released versions can be found here:
Latest JEAF Mail Versions