Class MailConverterService


  • public class MailConverterService
    extends Object
    The MailConverterService provides methods to convert a Mail Message object into a html or pdf document.

    The service resolves embedded images and converts them into HTML base64 images (img tags with a data uri):

    Author:
    rsoika
    • Constructor Detail

      • MailConverterService

        public MailConverterService()
    • Method Detail

      • convertToHTML

        public String convertToHTML​(javax.mail.Message message)
                             throws IOException,
                                    javax.mail.MessagingException
        This method converts a MimeMessage object into HTML

        A mail may contain text or HTML content. If the mail is a plain text mail, than a HTML template will be used to convert the plain text into a HTML presentation.

        In case of a HTML mail, image source references to embedded mail parts will be extracted into in-line content.

        Throws:
        javax.mail.MessagingException
        IOException
        Exception