One of my servlets creates CSV content in a String variable.
I would like to send this CSV as an attachment file, but everyone knows the limitations of GAE: it is not possible to create a file. So, I decided to find another solution.
Mine should attach the CSV string as follows:
String csv = ""; Message msg = new MimeMessage(session); msg.setDataHandler(new DataHandler(new ByteArrayDataSource(csv.getBytes(),"text/csv"))); msg.setFileName("data.csv");
I receive mail, but without an application. The CSV string is integrated into the bulk of the mail.
How to connect this CSV string, such as a CSV file, to mail?
thanks
source share