Class ImageHtmlEmail


  • public class ImageHtmlEmail
    extends HtmlEmail

    Small wrapper class on top of HtmlEmail which encapsulates the required logic to retrieve images that are contained in "<img src=../>" elements in the HTML code. This is done by replacing all img-src-elements with "cid:"-entries and embedding images in the email.

    For local files the class tries to either load them via an absolute path or - if available - use a relative path starting from a base directory. For files that are not found locally, the implementation tries to download the element and link it in.

    The image loading is done by an instance of DataSourceResolver which has to be provided by the caller.

    Since:
    1.3
    • Field Detail

      • REGEX_IMG_SRC

        public static final java.lang.String REGEX_IMG_SRC
        Regexp for extracting <img> tags
        See Also:
        Constant Field Values
      • REGEX_SCRIPT_SRC

        public static final java.lang.String REGEX_SCRIPT_SRC
        regexp for extracting <script> tags
        See Also:
        Constant Field Values
    • Constructor Detail

      • ImageHtmlEmail

        public ImageHtmlEmail()