我正在尝试在我的 Play 项目中使用 Mailer 插件,但遇到了一些麻烦。该项目编译良好,我可以在本地主机上访问该网站,但 Eclipse 显示错误:
def sendEmail = Action {
import play.api.Play.current
import com.typesafe.plugin._
val mail = use[MailerPlugin].email
mail.setSubject("mailer")
mail.addRecipient("Peter Hausel Junior <noreply@email.com>","example@foo.com")
mail.addFrom("Peter Hausel <noreply@email.com>")
//sends html
mail.sendHtml("<html>html</html>" )
//sends text/text
mail.send( "text" )
//sends both text and html
mail.send( "text", "<html>html</html>")
Ok(views.html.indexLoggedout())
}
错误是指第 2 行:plugin is not a member of com.typesafe
这是 Build.scala
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.4"
)
和 play.plugins
1500:com.typesafe.plugin.CommonsMailerPlugin
正如我所说,项目在使用时编译正常play compile
,只是 Eclipse 显示错误。我怎样才能解决这个问题?