try {
MIMEEntity topRelated = doc.createMIMEEntity("Body"); //$NON-NLS-1$
// Set up the multipart header
MIMEHeader header = topRelated.createHeader("Content-Type"); //$NON-NLS-1$
// EE needs to use multipart/alternative or the email clients will
// turn the content into an attachment.
header.setHeaderVal("multipart/related");
MIMEEntity topAlternative = topRelated.createChildEntity();
// Set up the multipart header
header = topAlternative.createHeader("Content-Type");
// EE needs to use multipart/alternative or the email clients will
// turn the content into an attachment.
header.setHeaderVal("multipart/alternative");
try {
for(MimePart part : getMimeParts()) {
MIMEEntity mime = topAlternative.createChildEntity();
try {