I'm on Rails 3.0.7 and having problems with the ActionMailer &
multipart emails -- has anyone verified that when sending multipart
emails they work correctly in several email readers?

Here's my mailer:

 def feature_announce(user)
   @user = user
   mail(:to => "#{user.name} <#{user.email}>",
        :subject => "Test Feature Announcement")
 end

I have a template for feature_announce.html.erb and another
feature_announce.text.erb

This syntax is taken straight from the ActionMailer guide for Rails 3.

The email works fine (plain text & html) in Apple Mail, but doesn't
appear correctly on Gmail (web browser interface) or on iPhone.

When I open the message in Gmail, I see this (I've obscured the sender
name)

http://screencast.com/t/V6zNUhjsE8A

If I click on the "noname" file and download it to my desktop, then
open it in a text editor I see the HTML that was supposed to make up
the body of the message.


When looking at the raw headers of the email, they appear a little
odd...

in the header:

Content-Type: multipart/alternative;
 boundary*="utf8'en'--==_mimepart_4dc028b2f0d86_2dc7800d21b03013b";
 charset*=utf8'en'UTF-8


But then I see 3 boundaries, like so:

----==_mimepart_4dc028b2f0d86_2dc7800d21b03013b
Date: Tue, 03 May 2011 12:09:22 -0400
Mime-Version: 1.0
Content-Type: text/plain;
 charset*=utf8'en'UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4dc028b2f392a_2dc7800d21b0302dc@Fleetwoods-
Mac.local.mail>

.... some plain text content (ommitted) ......

----==_mimepart_4dc028b2f0d86_2dc7800d21b03013b
Date: Tue, 03 May 2011 12:09:23 -0400
Mime-Version: 1.0
Content-Type: text/html;
 charset*=utf8'en'UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <[email protected]>


.... some HTML content (ommitted) ....


----==_mimepart_4dc028b2f0d86_2dc7800d21b03013b--

--utf8'en'--==_mimepart_4dc028b2f0d86_2dc7800d21b03013b--

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to