play activator-runtimeException:需要在application.conf中设置smtp.host才能使用此插件(或将smtp.mock设置为true)
我正在尝试运行名为“playStartApp”的play activator模板。 但是,它给了我以下运行时异常:play activator-runtimeException:需要在application.conf中设置smtp.host才能使用此插件(或将smtp.mock设置为true),exception,playframework,playframework-2.0,typesafe-activator,Exception,Playframework,Playframework 2.0,Typesafe Activator,我正在尝试运行名为“playStartApp”的play activator模板。 但是,它给了我以下运行时异常: RuntimeException: smtp.host needs to be set in application.conf in order to use this plugin (or set smtp.mock to true)\ java.lang.RuntimeException: smtp.host needs to be set in applicatio
RuntimeException: smtp.host needs to be set in application.conf in order to use this plugin (or set smtp.mock to true)\
java.lang.RuntimeException: smtp.host needs to be set in application.conf in order to use this plugin (or set smtp.mock to true)
com.typesafe.plugin.CommonsMailerPlugin$$anonfun$4.apply(MailerPlugin.scala:329)
com.typesafe.plugin.CommonsMailerPlugin$$anonfun$4.apply(MailerPlugin.scala:329)
scala.Option.getOrElse(Option.scala:120)
com.typesafe.plugin.CommonsMailerPlugin.mailerInstance$lzycompute(MailerPlugin.scala:329)
com.typesafe.plugin.CommonsMailerPlugin.mailerInstance(MailerPlugin.scala:326)
com.typesafe.plugin.CommonsMailerPlugin.onStart(MailerPlugin.scala:343)
play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)`
I tried both:
- set mail.smtp=mock
- mail.smtp.host=smtp.gmail.com
mail.smtp.user=yourGmailLogin
mail.smtp.pass=yourGmailPassword
mail.smtp.channel=ssl
pls suggest how to resolve this?
在“playStartApp”激活器模板中,您可以-
smtp.mock=true
smtp.host=smtp.gmail.com
smtp.port=587
smtp.user="user@gmail.com"
smtp.password="password"
smtp.ssl=true
mail.from="PlayStartApp@yourdomain.com"
mail.sign=The PlayStartApp Team
smtp.mock=true
smtp.host=smtp.gmail.com
smtp.port=587
smtp.user="user@gmail.com"
smtp.password="password"
smtp.ssl=true
mail.from="PlayStartApp@yourdomain.com"
mail.sign=The PlayStartApp Team
我也遇到了同样的问题,您找到解决方案了吗?在测试期间,如果您使用新的GlobalSettings,则不会加载您的conf。在这种情况下,将smtp.mock作为配置传递给全局设置:-
HashMap configMap=new HashMap();configMap.put(“smtp.mock”,true);application=play.test.Helpers.fakeApplication(configMap,new GlobalSettings())代码>