wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes Sending attachments with emails in Javamail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Sending attachments with emails in Javamail" Watch "Sending attachments with emails in Javamail" New topic

Sending attachments with emails in Javamail

Ajay Saxena
Ranch Hand

Joined: Nov 13, 2006
Posts: 154
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



I agree. Here's the link: http://aspose.com/file-tools
subject: Sending attachments with emails in Javamail
Similar Threads
How to send java mail with big file attached
JavaMail API error
Attach a generated pdf in a mail
How to send mail to more than one recipients