views:

20

answers:

0

Hi,

I'd like to prepare simple html email with alternative plain-text version. I don't need any attachments or inline elements.

By default if I use:

MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");

I get MimeMessageHelper.MULTIPART_MODE_MIXED_RELATED mode.

My email content body looks like this:

Content-Type: multipart/mixed; 
    boundary="----=_Part_8_21489995.1282317482209"

------=_Part_8_21489996.1282317482209
Content-Type: multipart/related; 
    boundary="----=_Part_9_21489996.1282317482209"

------=_Part_9_21489996.1282317482209
Content-Type: multipart/alternative; 
    boundary="----=_Part_10_2458205.1282317482209"

------=_Part_10_2458205.1282317482209
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Simple newsletter.

------=_Part_10_2458205.1282317482209
Content-Type: text/html;charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
    <head>
        <title>Simple newsletter</title>
    <head>
    <body>
        <p>Simple newsletter.</p>
    </body>
<html>

------=_Part_10_2458205.1282317482209--

------=_Part_9_21489996.1282317482209--

------=_Part_8_21489995.1282317482209--

What can I do to get rid of mixed and related boundries?

Ideal solution would be MimeMessageHelper.MULTIPART_MODE_ALTERNATIVE mode, but it's not available.