scala - NoSuchElementException in Play Framework while sending email? -


below, have pasted code sending mail attached file. don't missed in code getting nosuchelementexception in web application. can tell missing or there problem server part? have add apache or server licence in code project.

below code:

val email = email(   "simple email",   "mister <vignesh.gopal@hubino.com>",   seq("miss <ibrahim.sultan@hubino.com>"),   attachments = seq(     attachmentfile("leak.txt", new file("e:/oui_mem_leak.txt")),     attachmentdata("data.txt", "data".getbytes, "text/plain", some("simple data"), some(emailattachment.inline))),    bodytext = some("a text message"),   bodyhtml = some("<html><body><p>an <b>html</b> message</p></body></html>") ) println("email contents: " + email) mailerplugin.send(email) 

application.conf

smtp.host  = localhost smtp.port  = 9000 smtp.ssl   = false smtp.tls   = false smtp.debug = false smtp.mock  = false 

build.sbt

  "org.apache.commons" % "commons-email" % "1.3.3",   "com.typesafe.play" %% "play-mailer" % "2.4.1" 

exception:

! @6nj6i1d36 - internal server error, (get) [/stores/algo/file/download] ->  play.api.application$$anon$1: execution exception[[nosuchelementexception: none get]]         @ play.api.application$class.handleerror(application.scala:296) ~[play 2.11-2.3.9.jar:2.3.9]         @ play.api.defaultapplication.handleerror(application.scala:402) [play 2.11-2.3.9.jar:2.3.9]         @ play.core.server.netty.playdefaultupstreamhandler$$anonfun$14$$anonf n$apply$1.applyorelse(playdefaultupstreamhandler.scala:205) [play_2.11-2.3.9.ja :2.3.9]         @ play.core.server.netty.playdefaultupstreamhandler$$anonfun$14$$anonf n$apply$1.applyorelse(playdefaultupstreamhandler.scala:202) [play_2.11-2.3.9.ja :2.3.9]         @ scala.runtime.abstractpartialfunction.apply(abstractpartialfunction. cala:36) [scala-library-2.11.6.jar:na] caused by: java.util.nosuchelementexception: none.get         @ scala.none$.get(option.scala:347) ~[scala-library-2.11.6.jar:na]         @ scala.none$.get(option.scala:345) ~[scala-library-2.11.6.jar:na]         @ play.api.libs.mailer.mailerplugin$.send(mailerplugin.scala:25) ~[pla -mailer_2.11-2.4.1.jar:2.4.1] 

looks wrong configuration. have configured

1500:play.api.libs.mailer.commonsmailerplugin  

in conf/play.plugins?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -