/** * Gets first body part of the message. * * @return The primary body part. * @throws MessagingException An error occurred while getting the primary body part. * @since 1.0 */ protected BodyPart getPrimaryBodyPart() throws MessagingException { if (!initialized) { init(); } // Add the first body part to the message. The fist body part must be if (this.primaryBodyPart == null) { primaryBodyPart = createBodyPart(); getContainer().addBodyPart(primaryBodyPart, 0); } return primaryBodyPart; }
/** * Add a new part to the email. * * @param multipart The part to add. * @param index The index to add at. * @return The email. * @throws EmailException An error occurred while adding the part. * @since 1.0 */ public Email addPart(final MimeMultipart multipart, final int index) throws EmailException { final BodyPart bodyPart = createBodyPart(); try { bodyPart.setContent(multipart); getContainer().addBodyPart(bodyPart, index); } catch (final MessagingException me) { throw new EmailException(me); } return this; }
/** * Add a new part to the email. * * @param partContent The content. * @param partContentType The content type. * @return An Email. * @throws EmailException see javax.mail.internet.MimeBodyPart * for definitions * @since 1.0 */ public Email addPart(final String partContent, final String partContentType) throws EmailException { final BodyPart bodyPart = createBodyPart(); try { bodyPart.setContent(partContent, partContentType); getContainer().addBodyPart(bodyPart); } catch (final MessagingException me) { throw new EmailException(me); } return this; }
final BodyPart bodyPart = createBodyPart(); try
/** * Gets first body part of the message. * * @return The primary body part. * @throws MessagingException An error occurred while getting the primary body part. * @since 1.0 */ protected BodyPart getPrimaryBodyPart() throws MessagingException { if (!initialized) { init(); } // Add the first body part to the message. The fist body part must be if (this.primaryBodyPart == null) { primaryBodyPart = createBodyPart(); getContainer().addBodyPart(primaryBodyPart, 0); } return primaryBodyPart; }
/** * Add a new part to the email. * * @param partContent The content. * @param partContentType The content type. * @return An Email. * @throws EmailException see javax.mail.internet.MimeBodyPart * for definitions * @since 1.0 */ public Email addPart(final String partContent, final String partContentType) throws EmailException { final BodyPart bodyPart = createBodyPart(); try { bodyPart.setContent(partContent, partContentType); getContainer().addBodyPart(bodyPart); } catch (final MessagingException me) { throw new EmailException(me); } return this; }
/** * Add a new part to the email. * * @param multipart The part to add. * @param index The index to add at. * @return The email. * @throws EmailException An error occurred while adding the part. * @since 1.0 */ public Email addPart(final MimeMultipart multipart, final int index) throws EmailException { final BodyPart bodyPart = createBodyPart(); try { bodyPart.setContent(multipart); getContainer().addBodyPart(bodyPart, index); } catch (final MessagingException me) { throw new EmailException(me); } return this; }
final BodyPart bodyPart = createBodyPart(); try