Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending attachments with emails in Javamail

Ajay Saxena
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to send attachments with emails using Javamail. Following is the code through which I'm trying to achieve that. It works as expected on a JRE1.6 environment. But on JRE1.5, the content of the file gets added to the mail body as text

Any pointers on the observed difference in behavior would be highly appreciated!

The email in case of JRE1.5 is as follows

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi...Test Mail
Content-Type: application/octet-stream; name=corba_architecture.pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=corba_architecture.pdf
Content-ID: Attachment



  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic