How to use play-plugins-mailer with Play 2.3 and Scala 2.11?
playframework, scala
Solution
It looks like the problem is somehow with the version of plugin that is available in the typesafe repo:
I've built the plugin from sources, published it to my local repository and then everything compiled fine.
In the `build.sbt` of the sample app there is:
resolvers += Resolver.file("LocalIvy", file(Path.userHome + File.separator + ".ivy2" + File.separator + "local"))(Resolver.ivyStylePatterns)
So it looks like the authors also had problems in compiling the app using the plugin deployed to the official repository.
UPDATE: Well, it compiled fine, but then failed at runtime with `java.lang.ClassNotFoundException: com.typesafe.plugin.CommonsMailerPlugin`
UPDATE 2: The sample `play.plugins` is also wrong, the correct one should be:
1500:play.api.libs.mailer.CommonsMailerPlugin
and then eveyrthing finally works
Problem
I am trying to use the play plugin for sending emails: https://github.com/playframework/play-mailer I have followed the instructions as found on github: added the dependency to build.sbt, created play.plugins with the specified content (do I need to register the file somehow)? but I get a compilation error: ``` object mailer is not a member of package play.api.libs ``` when trying to import ``` import play.api.libs.mailer._ ``` I get another compilation error on ``` val mail = use[MailerPlugin].email ``` MailerPlugin and use are not found. How to get this working? Note: the plugin is correctly downloaded (I can find it in my .ivy2 directory), but it is not listed as a dependency in my application. My build.sbt file: ``` name := ... version := "1.0-SNAPSHOT" scalaVersion := "2.11.2" resolvers += Resolver.typesafeRepo("releases") //"mysql" % "mysql-connector-java" % "5.1.31" libraryDependencies ++= Seq( "mysql" % "mysql-connector-java" % "5.1.24", "org.webjars" %% "webjars-play" % "2.3.0-2", "com.typesafe.play" %% "play-slick" % "0.8.0", "com.typesafe.play.plugins" %% "play-plugins-mailer" % "2.3.1", "org.mindrot" % "jbcrypt" % "0.3m" ) fork in Test := false lazy val root = (project in file(".")).enablePlugins(PlayScala) ``` And my play.plugins contains only: ``` 1500:com.typesafe.plugin.CommonsMailerPlugin ``` UPDATE: I've downloaded the sample project from https://github.com/playframework/play-mailer and tried to compile using sbt. It failed with exactly the same problem.