diff options
-rw-r--r-- | actionmailer/lib/action_mailer/part.rb | 5 | ||||
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/part.rb b/actionmailer/lib/action_mailer/part.rb index 977c0b2b5c..2bbb59cdb6 100644 --- a/actionmailer/lib/action_mailer/part.rb +++ b/actionmailer/lib/action_mailer/part.rb @@ -88,7 +88,10 @@ module ActionMailer part.parts << prt end - part.set_content_type(real_content_type, nil, ctype_attrs) if real_content_type =~ /multipart/ + if real_content_type =~ /multipart/ + ctype_attrs.delete 'charset' + part.set_content_type(real_content_type, nil, ctype_attrs) + end end headers.each { |k,v| part[k] = v } diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 1e04531753..26ba652f2a 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -330,6 +330,7 @@ class ActionMailerTest < Test::Unit::TestCase assert_equal "multipart/mixed", created.content_type assert_equal "multipart/alternative", created.parts.first.content_type assert_equal "bar", created.parts.first.header['foo'].to_s + assert_nil created.parts.first.charset assert_equal "text/plain", created.parts.first.parts.first.content_type assert_equal "text/html", created.parts.first.parts[1].content_type assert_equal "application/octet-stream", created.parts[1].content_type |