Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 89570 invoked from network); 20 Nov 2007 10:21:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2007 10:21:18 -0000 Received: (qmail 64972 invoked by uid 500); 20 Nov 2007 10:21:04 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 64886 invoked by uid 500); 20 Nov 2007 10:21:04 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 64877 invoked by uid 99); 20 Nov 2007 10:21:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 02:21:04 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 10:21:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 04F53714201 for ; Tue, 20 Nov 2007 02:20:43 -0800 (PST) Message-ID: <27089596.1195554043017.JavaMail.jira@brutus> Date: Tue, 20 Nov 2007 02:20:43 -0800 (PST) From: "Tobias Bocanegra (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (EMAIL-69) HtmlEmail generated email don't display in Macos X Mail.app In-Reply-To: <10647969.1194086990606.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/EMAIL-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12543845 ] Tobias Bocanegra commented on EMAIL-69: --------------------------------------- i guess the problem was introduced in issue [EMAIL-50]. suggest to use the "alternative" container not only if there are embedded images but also if both a html and text message are set, eg: boolean useAlternative = this.inlineEmbeds.size() > 0 || (EmailUtils.isNotEmpty(this.html) && EmailUtils.isNotEmpty(this.text)); and then later: msgText = new MimeBodyPart(); if (useAlternative) { subContainer.addBodyPart(msgText); } else { container.addBodyPart(msgText); } > HtmlEmail generated email don't display in Macos X Mail.app > ----------------------------------------------------------- > > Key: EMAIL-69 > URL: https://issues.apache.org/jira/browse/EMAIL-69 > Project: Commons Email > Issue Type: Bug > Affects Versions: 1.1 > Environment: Macos X 10.4 with Mail.app > Reporter: Numa Schmeder > > 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 > w3.org/TR/html4/loose.dtd"> > > > > = > =20 > =09 My Email > > > > Ch=C3=A8re Mme Dupont ,=20 >
> Blah Blah html content > > > ------=_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 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.