private Multipart createMultiPart ( ) throws MessagingException { Multipart multipart = new MimeMultipart ( "alternative" ) ; if ( textPart != null ) { // add text first, to give priority to html multipart . addBodyPart ( ( BodyPart ) createTextMimePart ( ) ) ; } if ( htmlPart != null ) { multipart . addBodyPart ( ( BodyPart ) createHtmlMimePart ( ) ) ; } return multipart ; }
Creates a Multipart from present parts .