How do you add a type parameter to a Content-Type header?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tina_Hekkala
Posted On:   Thursday, March 7, 2002 07:32 AM


I am trying to send a mail that contains a message using multipart-related.


I have tried using the following code, but it seems to make the boundary parameter disappear


mimemessage.setHeader("Content-type", "multipart/related;type="text/html"");

I have also tried to add my own boundary parameter to the code above and lots of other techniques but nothing seems to work.


I would really appreciate some help on this issue! Thanks!

Re: How do you add a type parameter to a Content-Type header?

Posted By:   Laurent_Mihalkovic  
Posted On:   Thursday, March 7, 2002 09:50 AM

hi there,


You may want to look more closely at the javadoc for the MimeMultipart class.


It indicates that the class implements a MimePart with a primary content type of "multipart", and a sub-type of "mixed". The documentation also indicates that it is up to us (users) to write sub-classes of MimeMultipart to implement any of the other content sub-type semantics. Thanks to JAF, you do not have to modify sun's original mail.jar to provide support for this mime type.

Conclusion: JavaMail does not support the "related" sub-type, but you can use MimeMultipart as a starting point to build your own implementation.


You may want to look at http://www.imc.org/rfc2387 for a description of the "multipart/related" content type.

cheers

About | Sitemap | Contact