aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Javamail formatting problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Javamail formatting problem" Watch "Javamail formatting problem" New topic
Author

Javamail formatting problem

Steven Hunter
Greenhorn

Joined: Jun 23, 2003
Posts: 1
I have a program that scans an inbox. If a message has an attachment then the attachment is saved to the local filesystem. If the message does not have an attachment, then it is assumed that the data is in the body of the email. This text is extracted and saved as a file to the local filesystem.
The problem is this, formatting is preseved in the saved attachment, but not in the saved body text. The sent emails contain fixed size field data e.g. Oracle sql loader style data and therefore all spaces and carriage returns MUST be preserved. Currently the saved output is removing spaces and adding carriage returns to the point that the saved file is almost half the size of the original body text.
The java source uses the folowing to get the body text:
Object content = message[i].getContent();
strMessageBody = content.toString();
Since the context type is text/plain then a String is all I can get the message back as.
What can I do to preserve formatting?
Thanks,
Steven.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Javamail formatting problem
 
Similar Threads
How to avoid IllegalStateException (Response Already Commited )
HTTP Status 405 - HTTP method GET is not supported by this URL
premature end of file
BufferedReader.readLine() skips lines
Formatting problem