title: How to attach multiple inline base64 encode image to the mail?
body: <p>I have the following code</p>
  
  <pre><code>final JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
          MimeMessage mimeMessage = mailSender.createMimeMessage();
          MimeMessageHelper helper;
      try { 
        helper = new MimeMessageHelper(mimeMessage, false, "utf-8");
        String htmlMsg = "&lt;body&gt;&lt;div style="padding-top: 1px"&gt;&lt;table 
         style="width: 100%"&gt;  &lt;tr&gt; &lt;td align="left"&gt;&lt;img align="left" 
         src="cid:**image1**" style="margin-left: -7px; width: 50%;"&gt;&lt;/td&gt;                                    
         &lt;td align="right"&gt;&lt;img align="right" src="cid:**image2**"                    
        style="margin-left: 100px; width: 50%;"&gt; &lt;/td&gt;   &lt;/tr&gt; &lt;/table&gt;&lt;/div&gt; 
         &lt;body&gt;"
  
  
  
          Multipart multipart = new MimeMultipart("related");
          MimeBodyPart messageBodyPart = new MimeBodyPart();
          messageBodyPart.setContent(htmlMsg, "text/html");
          messageBodyPart.setDisposition(BodyPart.INLINE);
          multipart.addBodyPart(messageBodyPart);
          InternetHeaders headers = new InternetHeaders();
          headers.addHeader("Content-Type", "image/png");
          headers.addHeader("Content-Transfer-Encoding", "base64");
          String base64EncodedImageContentByteArray="encdoe value";
          String base64EncodedImageContentByteArray1 = "encoded value";
          MimeBodyPart imagePart1 = new MimeBodyPart(headers, 
          base64EncodedImageContentByteArray.getBytes());
          imagePart1.setDisposition(MimeBodyPart.INLINE);
          imagePart1.setContentID("image1");
          imagePart1.setFileName("image1.jpg");
          MimeBodyPart imagePart2 = new MimeBodyPart(headers, 
          base64EncodedImageContentByteArray1.getBytes());
          imagePart2.setDisposition(MimeBodyPart.INLINE);
          imagePart2.setContentID("image2");
          imagePart2.setFileName("image2.jpg");
          multipart.addBodyPart(imagePart1);
          multipart.addBodyPart(imagePart2);
          multipart.addBodyPart(messageBodyPart);
          mimeMessage.setContent(multipart);
          mimeMessage.setHeader("MIME-Version", "1.0");
  </code></pre>
  
  <p>But when I received the mail the first image is not showing but the second image showing in the mail. For first image place it is showing cross. Also I need to attache multiple images(base64 encoded value) in the mail</p>