Skip to content
Angel Sanadinov edited this page Apr 10, 2017 · 1 revision

Sending e-mails using the core3.mail.Service:

Create service and send e-mail

import akka.actor.ActorRef
import akka.pattern.ask
import core3.mail.Service
import Service._

val service = system.actorOf(Service.props("<some host>", <some port>, "<some user>", "<some password>"))
// or with the default static.conf config: val service = system.actorOf(Service.props())
service ? SendMessage("<from-email>", Seq("<to-email>", "<to-email>"), "<some subject>", "<some (html) body>")

Static configuration:

server.static {

  ...

  //core3.mail.Service
  // Notes:
  // - Always uses TLS.
  mail {
    hostname = "localhost"
    port = 25
    username = "<some user>"
    password = "<some password>"
  }

  ...

}

Clone this wiki locally