Announcement Announcement Module
Collapse
No announcement yet.
MimeMessageHelper - setting top-level MIME type Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MimeMessageHelper - setting top-level MIME type

    Is it possible to use MimeMessageHelper to construct a message with the following MIME structure:

    Code:
    multipart/alternative
       text/plain
       text/html
    And this one:

    Code:
    multipart/alternative
      text/plain
      multipart/related
        text/html
        image/gif
        image/gif
    From what I've seen, creating the helper with the multipart parameter set to "true" results in the top-level type being set to multipart/related, and I don't see how to set it to multipart/alternative. I think this is the more common pattern used for messages with a plain text and an HTML part.

    Also, I think that for "attachments", it's most common to make the overall type multipart/mixed. This is more widely supported than multipart/related (it was in the original MIME RFC, whereas multipart/related was a later addition proposed by Netscape), and multipart/related is really only needed if you're sending HTML with embedded images, CSS files, etc.

    These are examples of common structures for messages with attachments:

    Code:
    multipart/mixed
      text/plain ("body" of message)
      application/x-pdf
    Or:

    Code:
    multipart/mixed
      multipart/alternative
        text/plain
        text/html
      application/x-pdf
    I realize I can use the JavaMail API directly to achieve this, but it would be nice if MimeMessageHelper could do this (and if it does, I'd appreciate it if someone could tell me how). Thanks.
Working...
X