<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: gmail doesn't like multipart/alternative MIME type?</title>
	<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type/</link>
	<description>Comments on Ask MetaFilter post gmail doesn't like multipart/alternative MIME type?</description>
	<pubDate>Thu, 29 May 2008 09:48:39 -0800</pubDate>
	<lastBuildDate>Thu, 29 May 2008 09:48:39 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: gmail doesn&apos;t like multipart/alternative MIME type?</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type</link>	
		<description>Does gmail not like the multipart/alternative MIME type? &lt;br /&gt;&lt;br /&gt; I&apos;m trying to use php&apos;s mail() function to send a multipart/alternative email out to some users. As far as I can tell, I&apos;ve got the headers and body text right, but when I test it on myself the mail appears blank in the gmail client. Thunderbird (set up to check the same gmail account) seems to like it ok, displaying the html section without issue. What gives?&lt;br&gt;
&lt;br&gt;
Here&apos;s an example message (actually generated, but with names/content replaced) for your perusal:&lt;br&gt;
From: someone@somewhere.net&lt;br&gt;
MIME-Version: 1.0&lt;br&gt;
Content-Type: multipart/alternative; boundary=&quot;bufu8040bufu8040&quot;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
--bufu8040bufu8040&lt;br&gt;
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;&lt;br&gt;
&lt;br&gt;
text version of message&lt;br&gt;
&lt;br&gt;
--bufu8040bufu8040&lt;br&gt;
Content-Type: text/html; charset=&quot;iso-8859-1&quot;&lt;br&gt;
&lt;br&gt;
html version of message&lt;br&gt;
&lt;br&gt;
--bufu8040bufu8040</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.92692</guid>
		<pubDate>Thu, 29 May 2008 09:30:30 -0800</pubDate>
		<dc:creator>invitapriore</dc:creator>
		
			<category>gmail</category>
		
			<category>mime</category>
		
			<category>email</category>
		
			<category>php</category>
		
			<category>mail</category>
		
			<category>multipart</category>
		
			<category>alternative</category>
		
	</item> <item>
		<title>By: cmiller</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356749</link>	
		<description>Hmm, two questions:  &lt;br&gt;
&lt;br&gt;
Is the original preserved, if you go look at it, outside the rendering?&lt;br&gt;
&lt;br&gt;
Suppose you insert text before the first demarcation, &quot;this is outside the MIME tree, and should not be displayed.&quot;  What does that do?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356749</guid>
		<pubDate>Thu, 29 May 2008 09:48:39 -0800</pubDate>
		<dc:creator>cmiller</dc:creator>
	</item><item>
		<title>By: invitapriore</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356767</link>	
		<description>Thunderbird allows the option to view the message as HTML or as plain text, and both of the sections show up properly when their respective choice is selected, so it would seem that the body is preserved.&lt;br&gt;
&lt;br&gt;
Inserting text before the first boundary instance makes no difference, as expected.&lt;br&gt;
&lt;br&gt;
Thanks for the troubleshooting thus far.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356767</guid>
		<pubDate>Thu, 29 May 2008 10:01:20 -0800</pubDate>
		<dc:creator>invitapriore</dc:creator>
	</item><item>
		<title>By: invitapriore</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356769</link>	
		<description>Ah, I found the view source. It is indeed preserved.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356769</guid>
		<pubDate>Thu, 29 May 2008 10:04:13 -0800</pubDate>
		<dc:creator>invitapriore</dc:creator>
	</item><item>
		<title>By: gregjones</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356770</link>	
		<description>Gmail definitely does support multipart emails, so their must be something about yours specifically that it doesn&apos;t like. How many newlines are there after the first Content-Type line and before the boundary (it looks like 2 in your post...), it should just be one, and a little bell is ringing in my head about that having caused me problems in the past.&lt;br&gt;
&lt;br&gt;
Using something like Zend_Mail or ezMail will make it a lot easier, generating such emails by hand isn&apos;t a lot of fun.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356770</guid>
		<pubDate>Thu, 29 May 2008 10:06:54 -0800</pubDate>
		<dc:creator>gregjones</dc:creator>
	</item><item>
		<title>By: hades</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356787</link>	
		<description>I think that last line should be:&lt;br&gt;
&lt;br&gt;
--bufu8040bufu8040--&lt;br&gt;
&lt;br&gt;
But I don&apos;t know if that would cause problems for gmail.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356787</guid>
		<pubDate>Thu, 29 May 2008 10:25:59 -0800</pubDate>
		<dc:creator>hades</dc:creator>
	</item><item>
		<title>By: hattifattener</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356788</link>	
		<description>The final delimiter in a multipart message should have a double-dash at the end of the line as well as at the beginning. (see, ummmm, rfc2046 section 5.1.1, about midway through). I don&apos;t know if that&apos;s what&apos;s making gmail unhappy, though.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356788</guid>
		<pubDate>Thu, 29 May 2008 10:27:51 -0800</pubDate>
		<dc:creator>hattifattener</dc:creator>
	</item><item>
		<title>By: hattifattener</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356790</link>	
		<description>(curses! slowed by the desire to look up an rfc reference! :) )</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356790</guid>
		<pubDate>Thu, 29 May 2008 10:28:35 -0800</pubDate>
		<dc:creator>hattifattener</dc:creator>
	</item><item>
		<title>By: zsazsa</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356821</link>	
		<description>Consider letting PEAR&apos;s &lt;a href=&quot;http://pear.php.net/package/Mail_Mime&quot;&gt;Mail_Mime&lt;/a&gt; package handle all the MIME details for you.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356821</guid>
		<pubDate>Thu, 29 May 2008 10:57:26 -0800</pubDate>
		<dc:creator>zsazsa</dc:creator>
	</item><item>
		<title>By: invitapriore</title>
		<link>http://ask.metafilter.com/92692/gmail-doesnt-like-multipartalternative-MIME-type#1356866</link>	
		<description>Those last two dashes were it. Curse incomplete guides on the internet! &lt;br&gt;
&lt;br&gt;
Thanks, hades and hattifattener.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92692-1356866</guid>
		<pubDate>Thu, 29 May 2008 11:46:29 -0800</pubDate>
		<dc:creator>invitapriore</dc:creator>
	</item>
	</channel>
</rss>
