Note :- HTML body must be contain image tag as follows.
<img height="55" src="cid:image-id" width="65" />
Properties properties = new Properties();
properties.put("mail.smtp.host", "smtp host ip ");
Session session = Session.getDefaultInstance(properties, null);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject(subject);
message.setSentDate(new Date());
MimeBodyPart messagePart = new MimeBodyPart();
messagePart.setDataHandler(new DataHandler(new ByteArrayDataSource(body, "text/html")));
Multipart multipart = new MimeMultipart("related");
multipart.addBodyPart(messagePart);
multipart.addBodyPart(attachmentPart);
MimeBodyPart imagePart = new MimeBodyPart();
DataSource fds = new FileDataSource("image path ");
imagePart.setDataHandler(new DataHandler(fds));
imagePart.setFileName("logo.jpg");
imagePart.setHeader("Content-ID", "<image-id>
multipart.addBodyPart(imagePart);
message.setContent(multipart);
Transport.send(message);