Commons Email
  1. Commons Email
  2. EMAIL-69

HtmlEmail generated email don't display in Macos X Mail.app

    Details

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

      Macos X 10.4 with Mail.app

      Description

      Hi,

      The mail generated by HtmlEmail seems boggus in its mime layout. Mail.app doesn't recognize and display the html part when you send a mail with a Html and Text part as alternative.
      For example this email will only display the text part and not the html part on Mail.app:

      HtmlEmail htmlEmail = new HtmlEmail();
      htmlEmail.setHtmlMsg(htmlMessage);
      htmlEmail.setTextMsg(textMessage);
      email.setFrom(from,fromName);
      email.addTo(to, toName);
      email.setSubject(subject);
      email.send();

      But this email will disply correctly the html in Mail.app:

      HtmlEmail htmlEmail = new HtmlEmail();
      htmlEmail.setHtmlMsg(htmlMessage);
      email.setFrom(from,fromName);
      email.addTo(to, toName);
      email.setSubject(subject);
      email.send();

      The bug might be I think in the mime layout, I looked at the raw email source and the mime layout is as follow:

      MIME-Version: 1.0
      Content-Type: multipart/related;
      boundary="----=_Part_0_11727281.1194085710604"

      ------=_Part_0_11727281.1194085710604
      Content-Type: text/plain; charset=UTF-8
      Content-Transfer-Encoding: quoted-printable

      Ch=C3=A8re Mme Dupont ,=20

      Text Blah blah

      ------=_Part_0_11727281.1194085710604
      Content-Type: text/html; charset=UTF-8
      Content-Transfer-Encoding: quoted-printable

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.=
      w3.org/TR/html4/loose.dtd">
      <html version=3D"-//W3C//DTD HTML 4.01 Transitional//EN">
      <head>
      <meta name=3D"generator" content=3D"Le-Voyage.com mail generator 1.0"/>
      <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" />=
      =20
      =09 <title>My Email</title>
      </head>
      <body leftmargin=3D"0" topmargin=3D"0" marginwidth=3D"0" marginheight=3D"0"=
      >

      <b>Ch=C3=A8re Mme Dupont ,=20</b>
      <br/>
      Blah Blah html content
      </body>
      </html>

      -----=_Part_0_11727281.1194085710604-

      This is wrong, I am not an expert but shouldn't it be multipart/alternative ? In all other html email I have checked the mime layout uses multipart/alternative.
      I hop there is a quick fix for this.
      Thank you for your help.

      Numa

      1. EMAIL-69-test.patch
        2 kB
        Bjorn Townsend
      2. EMAIL-69-fix.patch
        0.8 kB
        Bjorn Townsend
      3. mail.app.patch
        0.8 kB
        Adhamh Findlay

        Activity

        Numa Schmeder created issue -
        Bjorn Townsend made changes -
        Field Original Value New Value
        Attachment EMAIL-69-fix.patch [ 12371465 ]
        Attachment EMAIL-69-test.patch [ 12371464 ]
        Adhamh Findlay made changes -
        Attachment mail.app.patch [ 12385423 ]
        Siegfried Goeschl made changes -
        Assignee Siegfried Goeschl [ sgoeschl ]
        Siegfried Goeschl made changes -
        Fix Version/s 1.2 [ 12313573 ]
        Siegfried Goeschl made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Siegfried Goeschl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Siegfried Goeschl
            Reporter:
            Numa Schmeder
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development