if (this.inlineAttachments ().count () > 0) {  MimeMultipart relatedMultiparts = new MimeMultipart ("related");   Enumeration en = this.inlineAttachments ().objectEnumerator (); while (en.hasMoreElements ()) { ERMailAttachment attachment = (ERMailAttachment)en.nextElement (); BodyPart bp = attachment.getBodyPart (); relatedMultiparts.addBodyPart (bp); }   BodyPart relatedAttachmentsBodyPart = new MimeBodyPart ();
BodyPart relatedAttachmentsBodyPart = new MimeBodyPart();
    protected DataHandler prepareMail () throws MessagingException {        MimeMultipart multipart = null;        MimeBodyPart textPart = null;        MimeBodyPart htmlPart = null;	this.mimeMessage ().setSentDate (new Date ());	multipart = new MimeMultipart ("alternative");			// set the plain text part	if (_hasHiddenPlainTextContent) {	    textPart = new MimeBodyPart ();	    textPart.setText (_hiddenPlainTextContent, charset());	    multipart.addBodyPart (textPart);	}	// create and fill the html message part	htmlPart = new MimeBodyPart ();	// Set the content of the html part	htmlPart.setContent (this.htmlContent (), "text/html; charset=\""  + charset () + "\"");	multipart.addBodyPart (htmlPart);	// Inline attachements	if (this.inlineAttachments ().count () > 0) {	    // Create a "related" MimeMultipart	    MimeMultipart relatedMultiparts = new MimeMultipart ("related");				    // add each inline attachments to the message	    Enumeration en = this.inlineAttachments ().objectEnumerator ();	    while (en.hasMoreElements ()) {		ERMailAttachment attachment = (ERMailAttachment)en.nextElement ();		BodyPart bp = attachment.getBodyPart ();		relatedMultiparts.addBodyPart (bp);	    }	    	    // Add this multipart to the main multipart as a compound BodyPart	    BodyPart relatedAttachmentsBodyPart = new MimeBodyPart ();	    relatedAttachmentsBodyPart.setDataHandler (new DataHandler (relatedMultiparts, relatedMultiparts.getContentType ()));	    multipart.addBodyPart (relatedAttachmentsBodyPart);	}        return new DataHandler (multipart, multipart.getContentType ());    }