E-Mail for Scala

Emil is a library for dealing with E-Mail in Scala. The api builds on Cats and FS2. It comes with a backend implementation that is based on the well known Java Mail library. As such it is just another wrapper library, but also a bit different:

  • Extensible DSL for creating mails in code.
  • Conveniently send mails via SMTP.
  • Search mail boxes via IMAP.
  • The data structures model a simplified E-Mail structure. Instead of adhering to the recursive structure of a mime message, a mail here is flat, consisting of a header, a body (text, html or both) and a list of attachments.
  • The data structures and api are in a separate module, that doesn’t depend on a concrete implementation library, like Java Mail. An implementation based on fs2-mail or even EWS can be created without affecting the user code of this library.

Write your e-mail related code once and then decide how to execute.


With sbt, add the dependencies:

"com.github.eikek" %% "emil-common" % "0.9.1"  // the core library
"com.github.eikek" %% "emil-javamail" % "0.9.1" // implementation module

Emil is provided for Scala 2.12 and 2.13.

There are extension modules that offer integration with other libraries or additional features based on third-party libraries.


This project is distributed under the MIT