Comments (3)
With play-mailers
own Email
class, currently this is not possible (yet). Right now we support only files or arrays as attachment.
However, play-mailer
uses Apache Commons Email under the hood, which provides some additional methods to attach(...)
attachments, like passing a javax.activation.DataSource
...
You are welcome to provide a pull request... You would need to add another method to handle a Source[ByteString, NotUsed]
and convert it to a DataSource
, similarly to these methods.
Actually looking at the code it looks like there is a workaound for now... The MailerClient
you inject is an object of CommonsMailer
, therefore you could use the the ยดcreateEmail(...) method which gives you a Apache Commons MultiPartEmail
which you can then send, like
val multipartEmail = commonsMailerClient.createEmail(myExistingEmail);
multipartEmail.attach(myDataSource, ...); // multipartEmail is Apaches own email implementation
....
commonsMailerClient.send(multipartEmail);
from play-mailer.
The project currently not use any akka deps, this was the main reason I didn't hop to a "lets make a PR" train.
What do you think, should we document this workaround, or create a module/artifact just for the additional streaming? Adding akka as a dep could be a pain, I would not cross that bridge if I don't need to...
from play-mailer.
Finally found time for a PR: #193
from play-mailer.
Related Issues (20)
- Compilation error when used with Play 2.6.18 and compile time injection HOT 2
- Unable to disable TLS v1.0 with play-mailer 5.0 (using Play 2.5.x) HOT 12
- Authentication Failure With Gmail in Play-Mailer 6.0.1 HOT 1
- Email sent goes to spam HOT 3
- New release or using the last dev version HOT 8
- office365 smtp session HOT 2
- Cross build for Scala 2.13.0
- No logs in mock mode (play 2.7) HOT 1
- .addTo() needs to be properly escaped or UTF-8 encoded HOT 1
- Unresolved dependencies path for 8.0.0 HOT 2
- NTLM authentication HOT 2
- Get a nullpointerexception when trying to send mail HOT 1
- SBT assembly HOT 3
- Not establishing StartTLS connection HOT 1
- [2.x] How to send a mail using TLSv1.2 or TLSv1.3 HOT 4
- Error - no object DCH for MIME type multipart/mixed HOT 1
- Add support for DKIM signing
- Switch to Jakarta Mail
- publish 9.0.0-M2 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-mailer.