solarmosaic / mail-client   0.1.0

MIT License GitHub

Scala mailer built on top of the JavaMail API.

Scala versions: 2.11 2.10

Scala SMTP Mail Client

A Scala SMTP mailer built on top of the JavaMail API.

Installation

Releases are available in Maven for Scala 2.10 and Scala 2.11. If you're using sbt, simply add the following to your build.sbt file:

libraryDependencies += "com.solarmosaic.client" %% "mail-client" % "0.1.0"

Usage

import com.solarmosaic.client.mail._
import com.solarmosaic.client.mail.configuration._
import com.solarmosaic.client.mail.content._

class ExampleClass extends EnvelopeWrappers {
  val config = SmtpConfiguration("localhost", 25)
  val mailer = Mailer(config)
  val content = Multipart(
    parts = Seq(Text("text"), Html("<p>text</p>")),
    subType = MultipartTypes.alternative
  )

  val envelope = Envelope(
    from = "[email protected]",
    to = Seq("[email protected]"),
    subject = "test",
    content = content
  )

  mailer.send(envelope)
}

For more detailed usage examples you may refer to the unit tests inside this repository.

Contributing

This repository is a mirror of our internal Gerrit repository. Therefore, we do not support merging code through Github itself. Please feel free to create issues or open pull requests here and we will do our best to resolve them internally.

Inspiration

This library was inspired by courier and scala-mail.

License

MIT