Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Setting headers correctly in Javamail

Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to convert a file into base64 to be attached to a mail sent via JavaMail and I'm really trying to get the header set as using Content-Transfer-Encoding base64 as the file is an .ics file and sending it via 7bit leaves it up to the whims of the client to read it correctly (according to my reading of RFC 2045). I suppse I'm trying to do what Google does succesfully and set the following header:

but I'm getting:

The code that I've been using is:

I don't seem to be able to get the FileOutputStream to encode at all. I did try:

to get the string containing the data encoded but again, I've failed to be able to set the base64 header as the email turns up as Content-Transfer-Encoding: quotable-printed and the content-type stays as application/octet stream, despite trying to set the header in the DataSource line.
I'd be grateful for any pointers in solving this issue so that I can take luck out of our email equation.

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic