java


File not attaching using play framework play mailer plugin


We are using the below plugin for sending e-mails within our Play application. The sending e-mail part works perfectly OK but when I add an attachment, I am running into the below error which indicates the file is not present. Though I am 100% sure the file is present on my disk and also later it passes my vaidation test in code as well
Adding attachment in code
email.addAttachment(fileName,new File ("path"))
https://github.com/playframework/play-mailer
Error stack :
2017-05-15 20:37:15,870 [ERROR] from application in application-akka.actor.default-dispatcher-10 - org.apache.commons.mail.EmailException: Cannot attach file "/tmp/playtemp7007305302758557514/multipartBody5483238492998817693asTemporaryFile"
at org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:334)
at play.api.libs.mailer.CommonsMailer.play$api$libs$mailer$CommonsMailer$$handleAttachmentFile(MailerPlugin.scala:251)
at play.api.libs.mailer.CommonsMailer$$anonfun$createEmail$10.apply(MailerPlugin.scala:150)
at play.api.libs.mailer.CommonsMailer$$anonfun$createEmail$10.apply(MailerPlugin.scala:146)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
at play.api.libs.mailer.CommonsMailer.createEmail(MailerPlugin.scala:146)
at play.api.libs.mailer.CommonsMailer.send(MailerPlugin.scala:130)
at play.api.libs.mailer.SMTPMailer.send(MailerPlugin.scala:110)
at play.api.libs.mailer.SMTPDynamicMailer.send(MailerPlugin.scala:117)
at play.api.libs.mailer.MailerClient$class.send(MailerPlugin.scala:56)
at play.api.libs.mailer.SMTPDynamicMailer.send(MailerPlugin.scala:114)

Related Links

spring authentication provider VS authentication processing filter
JSFs: commandLink as a parameter for outputFormat
Toplink/java persistency mystery time sink
How to implement AWS signed requests with amazon java library?
ICEFaces 'Content is not allowed in prolog' Error
Looking for a bitwise operator
How do I prevent JPA inserts from locking a database table?
Java Problem running a .bat file
Can I inject a SessionBean into a Java EE AroundInvoke-Interceptor?
JPA: How do I specify the table name corresponding to a class at runtime?
How can I terminate a running Maven build in NetBeans?
Noise in background when generating sine wave in Java
Porting a servlet to a web service - accessing the context?
Matching the contents of a binary file from tags (Java)
Load properties file in a java servlet deployed in JBoss as a war
Overriding HashSet's Contains Method

Categories

HOME
java
testing
deployment
activiti
platform-builder
syntax
jgroups
windows-server
maude-system
spring-tool-suite
commonmark
saxon
grails3
immutable.js
nas
paging
cx-freeze
scriptcs
excel-2007
captiveportal
android-widget
spark-jobserver
internet-explorer-9
info.plist
social-media
saas
windows-server-2000
libssl
r-raster
preg-match
media-queries
geopositioning
xcode-extension
twitch
unobtrusive-validation
broadcastreceiver
ws-security
reportingservices-2005
elmah
turbogears
atomicity
jedis
fancybox-2
idisposable
windows-iot-core-10
webdriverjs
synchronous
crosswalk-runtime
visual-c++-2008
deadbolt-2
login-control
mathematica-frontend
mongocsharpdriver
contact-list
goose
netmq
sysinternals
iiviewdeckcontroller
dia
ng-animate
gadt
onactivityresult
eol
funcunit
comexception
xceed-datagrid
cloud-connect
pyhdf
excel-2003
padarn
yui-compressor
twrequest
wse3.0
gcj
mongomapper
w3wp.exe
subviews
sortable-tables
icanhaz.js
preference
nsviewanimation
asp.net-profiles
compiler-specific
aquaticprime
multiple-languages
rtml

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App