diff options
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 6 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/mail_helper.rb | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 3a82979d35..9fb3ba425f 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -612,7 +612,11 @@ module ActionMailer #:nodoc: when user_content_type.present? user_content_type when m.has_attachments? - ["multipart", "mixed", params] + if m.attachments.detect { |a| a.inline? } + ["multipart", "related", params] + else + ["multipart", "mixed", params] + end when m.multipart? ["multipart", "alternative", params] else diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb index aab6e12387..b708881edf 100644 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ b/actionmailer/lib/action_mailer/mail_helper.rb @@ -32,5 +32,10 @@ module ActionMailer def message @_message end + + # Access the message attachments list. + def attachments + @_message.attachments + end end end |