I have encountered a problem attaching dynamically generated Excel file to my email. I'm using Jakarta Commons Email I can easily attache file using just a path or Web URL but can't figure out how to attach InputStream or byte. Can someone help me with that.
Some email clients, including web-based clients, cannot handle HTML or multi-part emails properly. Instead of displaying the HTML part, they try to search for a plain text part and display that. Everything else becomes an attachment.
You should always include a plain text part as well when sending HTML emails, because of these clients. That's why HtmlEmail has 3 methods for setting the body text - two for HTML and one for plain text.
Joined: Sep 15, 2008
One more question.
When I'm creating ByteArrayDataSource first I need to include byte file and then aType.
Can you explain me what aType stands for? As I figure out that the format should be "application/type". can I put anything there and specify format only when I'm attaching file (emali.attach(ds, "file.xls", "description"))