I have an array of bytes that I want to add as an attachment to the email I'm sending.
Unfortunately, I cannot find how to attach it as an array of bytes. In the solution, I have files on the disk (which I do not need, since I do not want to write an array of bytes so that I can attach it).
I found one solution that involves creating an object that extends the DataSource and uses it as a wrapper for an array of bytes, and then passes it to MimeBodyPart.
Does anyone know of a better solution?
source share