Emil alternatives and similar packages
Based on the "Misc" category.
Alternatively, view Emil alternatives based on common mentions on social networks and blogs.
-
BootZooka
Simple project to quickly start developing a Scala-based microservice or web application, without the need to write login, user registration etc. -
ScalaSTM
A library-based Software Transactional Memory (STM) for Scala, coupled with transactional sets and maps -
Miniboxing
Miniboxing is a program transformation that improves the performance of Scala generics when used with primitive types. It can speed up generic collections by factors between 1.5x and 22x, while maintaining bytecode duplication to a minimum. You can easily add miniboxing to your sbt project: -
aws4s
DISCONTINUED. Non-blocking AWS SDK for Scala exposing strongly-typed APIs built on top of http4s, fs2 and cats -
media4s
Scala command-line wrapper around ffmpeg, ffprobe, ImageMagick, and other tools relating to media. -
powerscala
Powerful framework providing many useful utilities and features on top of the Scala language. -
GoogleApiScala
This API is a wrapper for the google java libraries. Currently mapping Admin Directory, Drive, and Calendar. -
Easy Config
Easy Config makes Scala application configuration extremely easy. It reads configuration from the environment or command line arguments.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Emil or a related project?
README
Emil - Email without a
[\/]
Emil is a library for working 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.
Usage
With sbt, add the dependencies:
"com.github.eikek" %% "emil-common" % "0.10.0-M2" // the core library
"com.github.eikek" %% "emil-javamail" % "0.10.0-M2" // implementation module
// … optionally, other modules analog
Emil is provided for Scala 2.12, 2.13 and 3. Note: from 0.10.0 emil is builta against CE3. Also from this version onwards, support for scala3 has been added.
Examples
Send a mail (returning its messageID
):
import cats.effect._
import cats.data.NonEmptyList
import emil._, emil.builder._
import emil.javamail._
val mail: Mail[IO] = MailBuilder.build(
From("[email protected]"),
To("[email protected]"),
Subject("Hello!"),
CustomHeader(Header("User-Agent", "my-email-client")),
TextBody("Hello!\n\nThis is a mail."),
HtmlBody("<h1>Hello!</h1>\n<p>This <b>is</b> a mail.</p>"),
AttachUrl[IO](getClass.getResource("/files/Test.pdf")).
withFilename("test.pdf").
withMimeType(MimeType.pdf)
)
val myemil = JavaMailEmil[IO]()
val smtpConf = MailConfig("smtp://devmail:25", "dev", "dev", SSLType.NoEncryption)
val sendIO: IO[NonEmptyList[String]] = myemil(smtpConf).send(mail)
Searching for mails:
import java.time._
import cats.effect._
import emil._
import emil.SearchQuery._
import emil.javamail._
val myemil = JavaMailEmil[IO]()
val imapConf = MailConfig("imap://devmail:143", "dev", "dev", SSLType.NoEncryption)
def searchInbox[C](a: Access[IO, C], q: SearchQuery): MailOp[IO, C, SearchResult[MailHeader]] =
for {
inbox <- a.getInbox
mails <- a.search(inbox, 20)(q)
} yield mails
val q = (ReceivedDate >= Instant.now.minusSeconds(60)) && (Subject =*= "test")
val searchIO: IO[SearchResult[MailHeader]] = myemil(imapConf).run(searchInbox(myemil.access, q))
Documentation
More information can be found here.