I was just learning javax.mail API for sending mails. But I observed that MimeMessage.setText() methods accept String parameter that is used as mail body. But what if we want to put large text data as mail body? Is there any way to read file data in form of say input stream and pass that stream to setText method, so that we can save large text data in text file and read that file content and send those content to setText method.
Please guide me.
I am slow but sure
posted 5 years ago
People are not going to bother reading long pieces of bulk mail, so you should reconsider your approach. In any case, it's easy to read the contents of an InputStream into a String.