• Post Reply Bookmark Topic Watch Topic
  • New Topic

Two layer of Mime Packaging

 
kacuak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to construct a 2 layer MIME message as below by using Java Mail API. There was two layer of mime packaging, a mime message was encapsulated by another layer of mime packaging.

Example (Correct):

Content-Type: Multipart/related;Boundary=�HTTP-Body-Boundary�;type=�multipart/related�
Content-Length: 1896

--HTTP-Body-Boundary

Content-Type: multipart/related;boundary=�RN-Outer-Boundary�;type=�application/xml�
Content-Description: xxxxxxxxxx

--Outer-Boundary
Content-Type: Application/XML
Content-Location: Content-1-Header
Content-ID: <value>

[Content 1 goes here]

--Outer-Boundary
Content-Type: Application/XML
Content-Location: Content-2-Header
Content-ID: <value>

[Content 2 goes here]

--Outer-Boundary--

--HTTP-Body-Boundary--


But end up I got a message like below where there was duplicate headers of the inner Mime message because the inner mime message is the content of the body part of outer mime message:-


Example(Wrong)
Content-Type: Multipart/related;Boundary=�HTTP-Body-Boundary�;type=�multipart/related�
Content-Length: 1896

--HTTP-Body-Boundary

Content-Type: Application/XML
Content-Location: xxxxxxxxxx

Content-Type: multipart/related;boundary=�RN-Outer-Boundary�;type=�application/xml�
Content-Description: xxxxxxxxxx

--Outer-Boundary
Content-Type: Application/XML
Content-Location: Content-1-Header
Content-ID: <value>

[Content 1 goes here]

--Outer-Boundary
Content-Type: Application/XML
Content-Location: Content-2-Header
Content-ID: <value>

[Content 2 goes here]

--Outer-Boundary--

--HTTP-Body-Boundary--

May I know can I construct a two layer mime packaging as the example shown using standard Java mail API? Someone told me that I will need to create wrapper class for this case, is it the only way to do that?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!