title: Preparing simple multipart/alternative email using MimeMessageHelper (Spring Framework)
body: <p>I'd like to prepare simple html email with alternative plain-text version.
  I don't need any attachments or inline elements.</p>
  
  <p>By default if I use:</p>
  
  <pre><code>MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
  </code></pre>
  
  <p>I get <code>MimeMessageHelper.MULTIPART_MODE_MIXED_RELATED</code> mode.</p>
  
  <p>My email content body looks like this:</p>
  
  <pre><code>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
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Simple newsletter&lt;/title&gt;
      &lt;head&gt;
      &lt;body&gt;
          &lt;p&gt;Simple newsletter.&lt;/p&gt;
      &lt;/body&gt;
  &lt;html&gt;
  
  ------=_Part_10_2458205.1282317482209--
  
  ------=_Part_9_21489996.1282317482209--
  
  ------=_Part_8_21489995.1282317482209--
  </code></pre>
  
  <p>What can I do to get rid of mixed and related boundries?</p>
  
  <p>Ideal solution would be <code>MimeMessageHelper.MULTIPART_MODE_ALTERNATIVE</code> mode, but it's not available.</p>