Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail rendering multipart/alternative messages incorrectly?

Are there any known issues with Mail regarding the display of multipart/alternative messages? Messages I've sent as multipart/alternative render as expected in webmail and Thunderbird on OS X. Messages are being send with PEAR::Mail_mime and that package is handling all the headers. I've double-checked the headers as well as I know how and they seem to be fine.

I've read this post: http://discussions.apple.com/thread.jspa?threadID=1647884&tstart=0 which indicates that Mail might have issues with multipart/alternative, or multipart/mixed at least.

If there are no known issues with Mail handling mutlipart/alternative messages, are there some key headers that need to be set for Mail to display them correctly? I've compared headers for messages sent by Mail (to myself) and mail sent otherwise, and I don't notice anything that would cause them to render differently.

iMac, Mac OS X (10.5.4), Using Mail Version 3.3 (926.1/926)

Posted on Aug 4, 2008 3:03 PM

Reply
6 replies

Aug 5, 2008 6:30 AM in response to Mulder

These are multipart messages, they contain plain text and html content. Their headers are set with Content-type: multipart/alternative and have a boundary set as well.

Here is the raw source of a message. If you see anything I've missed regarding headers or anything, please let me know:

Return-Path: <anonymous@103776-domain>
Delivered-To: 64-name@firstroi.com
Received: (qmail 14455 invoked from network); 4 Aug 2008 17:27:54 -0500
Received: from domain (HELO 103776-domain) (72.32.155.210)
by 192.168.1.212 with (DHE-RSA-AES256-SHA encrypted) SMTP; 4 Aug 2008 17:27:54 -0500
Received: (qmail 2638 invoked by uid 48); 4 Aug 2008 17:27:24 -0500
Date: 4 Aug 2008 17:27:24 -0500
Message-ID: <20080804222724.2633.qmail@103776-domain>
To: [name] <name@email.com>
Subject: [Some subject]
MIME-Version: 1.0
From: [name] <name@email.com>
Content-Type: multipart/alternative; boundary="=_27d0b21e07eb49dc5bc5574cf81233d9"

--=_27d0b21e07eb49dc5bc5574cf81233d9
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="ISO-8859-1"

taf2 plain text
--=_27d0b21e07eb49dc5bc5574cf81233d9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="ISO-8859-1"

sdasdf

Aug 5, 2008 7:01 AM in response to lolotov

Well, I never send HTML email so I couldn't tell you whether or not the headers are correct or if it requires anything else. But if you open Safari and go to any web page and use the Mail Contents of This Page command, it will open Mail and insert the page, graphics and all. You can also add text to that email.

If you then view the raw source of that message, you'll see what Mail requires in terms of sending headers for HTML web pages; that would probably help you more.

Mulder

Aug 26, 2008 3:14 PM in response to lolotov

lolotov wrote:
Content-Type: multipart/alternative; boundary="=_27d0b21e07eb49dc5bc5574cf81233d9"

--=_27d0b21e07eb49dc5bc5574cf81233d9
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="ISO-8859-1"

taf2 plain text
--=_27d0b21e07eb49dc5bc5574cf81233d9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="ISO-8859-1"

sdasdf


i believe you are missing your 3rd and final boundry that is necessary after your HTML code, and also should have two hyphens "--" added at the end of the 3rd boundry. IE:

Content-Type: multipart/alternative; boundary="=_27d0b21e07eb49dc5bc5574cf81233d9"

--=_27d0b21e07eb49dc5bc5574cf81233d9

plain text

--=_27d0b21e07eb49dc5bc5574cf81233d9

html code

--=_27d0b21e07eb49dc5bc5574cf81233d9 --

(without the space between the random hash and the last 2 hyphens, this message board strokes out the line if i don't put a space there... you get the idea)



also, make sure there are no blank lines between your boundaries and your Content-Transfer-Encoding lines as Mail has a (very dumb) problem with understanding the information if there are spaces present between these lines.

Message was edited by: DarkroomMTL

Message was edited by: DarkroomMTL

Message was edited by: DarkroomMTL

Sep 15, 2008 9:33 AM in response to DarkroomMTL

Holy Frost-wyrm batman!

Thanks for the reply! We actually just reverted to sending plain-text messages. On an off-chance I checked this thread again. I'm going to investigate your suggestions. I want to mark your answer helpful, but I don't know if I'll be able to mark it as solved once I do. I'll hopefully get back to this thread within the day.

Mail rendering multipart/alternative messages incorrectly?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.