Commons Email
  1. Commons Email
  2. EMAIL-137

MimeMessageParser throws ClassCastException for HtmlEmail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.3.3
    • Labels:
      None
    • Environment:

      Java 1.6 + Scala 2.10.3 + Play! 2.2.2

      Description

      MimeMessageParser throws ClassCastException when parsing just created and built HtmlEmail:

      java.lang.ClassCastException: javax.mail.internet.MimeMultipart cannot be cast to java.lang.String
      at org.apache.commons.mail.util.MimeMessageParser.parse(MimeMessageParser.java:176) ~[commons-email-1.3.2.jar:1.3.2]
      at org.apache.commons.mail.util.MimeMessageParser.parse(MimeMessageParser.java:85) ~[commons-email-1.3.2.jar:1.3.2]
      at utils.EmailSender$.emailForAutomation(EmailSender.scala:382) ~[classes/:na]

      Here is the test code:

      def emailForAutomation(email: HtmlEmail): String =

      { email.buildMimeMessage() val mimeMessage = email.getMimeMessage() val parser = new MimeMessageParser(mimeMessage) parser.parse() parser.getHtmlContent() }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Alex Kogan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development