• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send bulk data using Javamail API

 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!