Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

streams in javamail  RSS feed

Karthik Iyer
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was using an SMTP mail program along with an UUEncoder class, that made it possible to pass a HTML formatted string as a parameter. This string will be converted into a html page and sent as an attachment with the email. However when i migrated to JavaMail, i found that the only way to send an attachment was if we had the file physically present in a folder (FileDataSource accepts a file name or a file object as a parameter).
Is there anyway that i can circumvent this and send a string as an attachment by writing it into a stream or something, so that the creation of the physical file in a folder can be avoided.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!