} else {
contentType = new ContentTypeBuilder(contentTypeValue);
//Use configures the baseType with multipart/related while no attachment exists or all the attachments are removed
if (contentType.getMediaType().equals(MediaType.MULTIPART_RELATED) && attachmentParts.size() == 0) {
contentType.setMediaType(getMediaType());
contentType.clearParameters();
}
}
//If it is of multipart/related, initialize those required values in the content-type, including boundary etc.
if (contentType.getMediaType().equals(MediaType.MULTIPART_RELATED)) {