Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Javamail: Proper embedding of Mime parts...

 
Nick St-Peter
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have a problem having consistent results (same rendering regardless of MUA) sending an email that has both a text/plain part, a text/html part, a few pictures that the text/html part must show and attach a PDF to the end result...

The problem seems to be related to how I embed each part together...

Is the multipart/related part supposed to contain the multipart/alternative one (which would contain the text/plain and text/html part) and the pictures or is the multipart/alternative part supposed to contain a text/plain part and a multipart/related part which would contain the text/html part and the pictures?

The end result is then put into a multipart/mixed and the PDF file is attached then to it.

I've seen examples of both and I'm wondering which one is the "correct one"...

Thank you!

Nick
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try both of them?

Although I have to say, I wouldn't expect mail clients to render a complicated structure like that consistently anyway. Hotmail and Lotus Notes don't always agree on how to render a message.
 
Nick St-Peter
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Clapham:
Did you try both of them?

Although I have to say, I wouldn't expect mail clients to render a complicated structure like that consistently anyway. Hotmail and Lotus Notes don't always agree on how to render a message.


I did the multipart/alternative that contains a multipart/related and it worked with everything I tried so far except an old Mozilla mail client.

Talking of Lotus Notes we do use it here and when I sent the multipart/alternative that contains a multipart/related to Lotus Notes and then forwarded it back to that Mozilla mail client it worked and I noticed that Notes had instead sent a multipart/related that contains a multipart/alternative...

With Mozilla Thunderbird both ways work so I don't know if it's a quirk of that old Mozilla mail client or not...

(And both ways seems to work with other MUAs as well)

I must confess that I am a little wary of using one over the other just based on the testing I can do with the MUAs (mail clients) I use (or can use to do some tests) and I must confess that I find the multipart/related that contains the multipart/alternative a little unnatural (but maybe I'm misunderstanding their use).

Thank you for your help!

Nick
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say, if you have Lotus Notes to test with, that's the most likely client to do weird stuff. I have an acquaintance who sends me e-mails from work, and that's what he uses there, and when I read them in my web-based mail system they look quite bizarre.
 
Nick St-Peter
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It most definitely has quirks you won't find elsewhere...

Thank you very much for your help!

Nick
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!