I would like to use javamail to send plain text messages. No messages will have attachments or be in html format. The content of a message is a mixture of static text and dynamic content. I would like to keep the static content in a text file, and read it in.
My problem is the best way to read the content such that I can:
1) replace designated placeholders in the static content with the dynamic content.
2) pass the content as a
String to the MimeMessage class's setText method.
Should I just use standard java.io classes (e.g. InputStream), or should I use the
Java Activation Framework for instance?
Also, this approach will see the contents of my text file to a (very long) String - will I lose the text formatting?
One way I have explored is to make the message multipart, but this seems to be the wrong approach as the message is to be plain text (therefore multipart is a misleading and inaccurate header for the email).
Any help/ideas much appreciated.
John